Compare commits

..

2 Commits

Author SHA1 Message Date
Minio Trusted
b2aa1349f8 update to v0.3.17 2020-08-24 15:27:12 -07:00
Lenin Alevski
8b62aec7fb Added support for prometheus addnotations #293 (#256) 2020-08-24 15:07:36 -07:00
7 changed files with 30 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ spec:
serviceAccountName: console-sa
containers:
- name: console
image: minio/console:v0.3.16
image: minio/console:v0.3.17
imagePullPolicy: "IfNotPresent"
args:
- server

View File

@@ -15,7 +15,7 @@ spec:
serviceAccountName: console-sa
containers:
- name: console
image: minio/console:v0.3.16
image: minio/console:v0.3.17
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_OPERATOR_MODE

View File

@@ -48,6 +48,9 @@ type CreateTenantRequest struct {
// enable console
EnableConsole *bool `json:"enable_console,omitempty"`
// enable prometheus
EnablePrometheus *bool `json:"enable_prometheus,omitempty"`
// enable tls
EnableTLS *bool `json:"enable_tls,omitempty"`

View File

@@ -626,7 +626,7 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
return nil, err
}
const consoleVersion = "minio/console:v0.3.16"
const consoleVersion = "minio/console:v0.3.17"
minInst.Spec.Console = &operator.ConsoleConfiguration{
Replicas: 1,
Image: consoleVersion,
@@ -681,10 +681,12 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
}
// add annotations
var annotations map[string]string
if len(tenantReq.Annotations) > 0 {
if minInst.Spec.Metadata == nil {
minInst.Spec.Metadata = &metav1.ObjectMeta{}
if minInst.Spec.Metadata == nil {
minInst.Spec.Metadata = &metav1.ObjectMeta{
Annotations: map[string]string{},
}
}
if len(tenantReq.Annotations) > 0 {
annotations = tenantReq.Annotations
minInst.Spec.Metadata.Annotations = annotations
}
@@ -718,6 +720,13 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
}
}
// prometheus annotations support
if tenantReq.EnablePrometheus != nil && *tenantReq.EnablePrometheus && minInst.Spec.Metadata != nil && minInst.Spec.Metadata.Annotations != nil {
minInst.Spec.Metadata.Annotations["prometheus.io/path"] = "/minio/prometheus/metrics"
minInst.Spec.Metadata.Annotations["prometheus.io/port"] = fmt.Sprint(operator.MinIOPort)
minInst.Spec.Metadata.Annotations["prometheus.io/scrape"] = "true"
}
// set console image if provided
if tenantReq.ConsoleImage != "" {
minInst.Spec.Console.Image = tenantReq.ConsoleImage

View File

@@ -871,7 +871,7 @@ func Test_UpdateTenantAction(t *testing.T) {
},
params: admin_api.UpdateTenantParams{
Body: &models.UpdateTenantRequest{
ConsoleImage: "minio/console:v0.3.16",
ConsoleImage: "minio/console:v0.3.17",
},
},
},

View File

@@ -2038,6 +2038,10 @@ func init() {
"type": "boolean",
"default": true
},
"enable_prometheus": {
"type": "boolean",
"default": false
},
"enable_tls": {
"type": "boolean",
"default": true
@@ -5992,6 +5996,10 @@ func init() {
"type": "boolean",
"default": true
},
"enable_prometheus": {
"type": "boolean",
"default": false
},
"enable_tls": {
"type": "boolean",
"default": true

View File

@@ -1837,6 +1837,9 @@ definitions:
enable_tls:
type: boolean
default: true
enable_prometheus:
type: boolean
default: false
namespace:
type: string
erasureCodingParity: