Compare commits

..

4 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
Minio Trusted
83fe33b499 update to v0.3.16 2020-08-20 23:09:02 -07:00
Daniel Valdivia
54d0a1d342 Support for labels at pvc level (#254) 2020-08-20 22:46:07 -07:00
8 changed files with 57 additions and 8 deletions

View File

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

View File

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

View File

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

View File

@@ -207,6 +207,9 @@ func (m *Zone) UnmarshalBinary(b []byte) error {
// swagger:model ZoneVolumeConfiguration // swagger:model ZoneVolumeConfiguration
type ZoneVolumeConfiguration struct { type ZoneVolumeConfiguration struct {
// labels
Labels map[string]string `json:"labels,omitempty"`
// size // size
// Required: true // Required: true
Size *int64 `json:"size"` Size *int64 `json:"size"`

View File

@@ -626,7 +626,7 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
return nil, err return nil, err
} }
const consoleVersion = "minio/console:v0.3.15" const consoleVersion = "minio/console:v0.3.17"
minInst.Spec.Console = &operator.ConsoleConfiguration{ minInst.Spec.Console = &operator.ConsoleConfiguration{
Replicas: 1, Replicas: 1,
Image: consoleVersion, Image: consoleVersion,
@@ -681,10 +681,12 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
} }
// add annotations // add annotations
var annotations map[string]string var annotations map[string]string
if len(tenantReq.Annotations) > 0 { if minInst.Spec.Metadata == nil {
if minInst.Spec.Metadata == nil { minInst.Spec.Metadata = &metav1.ObjectMeta{
minInst.Spec.Metadata = &metav1.ObjectMeta{} Annotations: map[string]string{},
} }
}
if len(tenantReq.Annotations) > 0 {
annotations = tenantReq.Annotations annotations = tenantReq.Annotations
minInst.Spec.Metadata.Annotations = 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 // set console image if provided
if tenantReq.ConsoleImage != "" { if tenantReq.ConsoleImage != "" {
minInst.Spec.Console.Image = tenantReq.ConsoleImage minInst.Spec.Console.Image = tenantReq.ConsoleImage
@@ -1141,7 +1150,8 @@ func parseTenantZoneRequest(zoneParams *models.Zone, annotations map[string]stri
// Pass annotations to the volume // Pass annotations to the volume
vct := &corev1.PersistentVolumeClaim{ vct := &corev1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "data", Name: "data",
Labels: zoneParams.VolumeConfiguration.Labels,
}, },
Spec: volTemp, Spec: volTemp,
} }

View File

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

View File

@@ -2038,6 +2038,10 @@ func init() {
"type": "boolean", "type": "boolean",
"default": true "default": true
}, },
"enable_prometheus": {
"type": "boolean",
"default": false
},
"enable_tls": { "enable_tls": {
"type": "boolean", "type": "boolean",
"default": true "default": true
@@ -3250,6 +3254,12 @@ func init() {
"size" "size"
], ],
"properties": { "properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"size": { "size": {
"type": "integer" "type": "integer"
}, },
@@ -5721,6 +5731,12 @@ func init() {
"size" "size"
], ],
"properties": { "properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"size": { "size": {
"type": "integer" "type": "integer"
}, },
@@ -5980,6 +5996,10 @@ func init() {
"type": "boolean", "type": "boolean",
"default": true "default": true
}, },
"enable_prometheus": {
"type": "boolean",
"default": false
},
"enable_tls": { "enable_tls": {
"type": "boolean", "type": "boolean",
"default": true "default": true
@@ -7126,6 +7146,12 @@ func init() {
"size" "size"
], ],
"properties": { "properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"size": { "size": {
"type": "integer" "type": "integer"
}, },

View File

@@ -1837,6 +1837,9 @@ definitions:
enable_tls: enable_tls:
type: boolean type: boolean
default: true default: true
enable_prometheus:
type: boolean
default: false
namespace: namespace:
type: string type: string
erasureCodingParity: erasureCodingParity:
@@ -2088,6 +2091,10 @@ definitions:
type: integer type: integer
storage_class_name: storage_class_name:
type: string type: string
labels:
type: object
additionalProperties:
type: string
resources: resources:
$ref: "#/definitions/zoneResources" $ref: "#/definitions/zoneResources"
node_selector: node_selector: