Skip to content

Commit

Permalink
never propagate labels/annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ramondeklein committed Oct 17, 2024
1 parent 630d02d commit fe4a452
Show file tree
Hide file tree
Showing 13 changed files with 231 additions and 203 deletions.
74 changes: 43 additions & 31 deletions docs/tenant_crd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,35 @@ Security Context
|===


[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-minio-min-io-v2-poolsmetadata"]
==== PoolsMetadata

PoolsMetadata (`poolsMetadata`) defines custom labels and annotations for the MinIO pool stateful sets / pods. +

.Appears In:
****
- xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-minio-min-io-v2-tenantspec[$$TenantSpec$$]
****

[cols="25a,75a", options="header"]
|===
| Field | Description

|*`labels`* __object (keys:string, values:string)__
|*Optional* +


If provided, append these labels to the MinIO statefulset / pods

|*`annotations`* __object (keys:string, values:string)__
|*Optional* +


If provided, append these annotations to the MinIO statefulset / pods

|===


[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-minio-min-io-v2-servicemetadata"]
==== ServiceMetadata

Expand Down Expand Up @@ -727,6 +756,18 @@ If provided, append these labels to the Console service

If provided, append these annotations to the Console service

|*`kesServiceLabels`* __object (keys:string, values:string)__
|*Optional* +


If provided, append these labels to the KES service

|*`kesServiceAnnotations`* __object (keys:string, values:string)__
|*Optional* +


If provided, append these annotations to the KES service

|===


Expand Down Expand Up @@ -777,35 +818,6 @@ sidecar's Resource, initcontainer will use that if set.
|===


[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-minio-min-io-v2-statefulsetmetadata"]
==== StatefulSetMetadata

StatefulSetMetadata (`statefulSetMetadata`) defines custom labels and annotations for the MinIO stateful sets. +

.Appears In:
****
- xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-minio-min-io-v2-tenantspec[$$TenantSpec$$]
****

[cols="25a,75a", options="header"]
|===
| Field | Description

|*`labels`* __object (keys:string, values:string)__
|*Optional* +


If provided, append these labels to the MinIO statefulset

|*`annotations`* __object (keys:string, values:string)__
|*Optional* +


If provided, append these annotations to the MinIO statefulset

|===


[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-minio-min-io-v2-tenant"]
==== Tenant

Expand Down Expand Up @@ -1183,11 +1195,11 @@ Directs the Operator to expose the MinIO and/or Console services. +

Specify custom labels and annotations to append to the MinIO service and/or Console service.

|*`statefulSetMetadata`* __xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-minio-min-io-v2-statefulsetmetadata[$$StatefulSetMetadata$$]__
|*`poolsMetadata`* __xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-minio-min-io-v2-poolsmetadata[$$PoolsMetadata$$]__
|*Optional* +


Specify custom labels and annotations to append to the MinIO statefulsets.
Specify custom labels and annotations to append to all pool statefulsets and pods.

|*`users`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#localobjectreference-v1-core[$$LocalObjectReference$$] array__
|*Optional* +
Expand Down
30 changes: 19 additions & 11 deletions helm/operator/templates/minio.min.io_tenants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3638,6 +3638,17 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
poolsMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
priorityClassName:
type: string
prometheusOperator:
Expand Down Expand Up @@ -3736,6 +3747,14 @@ spec:
additionalProperties:
type: string
type: object
kesServiceAnnotations:
additionalProperties:
type: string
type: object
kesServiceLabels:
additionalProperties:
type: string
type: object
minioServiceAnnotations:
additionalProperties:
type: string
Expand Down Expand Up @@ -5500,17 +5519,6 @@ spec:
format: int32
type: integer
type: object
statefulSetMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
subPath:
type: string
users:
Expand Down
14 changes: 0 additions & 14 deletions pkg/apis/minio.min.io/v2/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -878,20 +878,6 @@ func GetClusterDomain() string {
return k8sClusterDomain
}

// MergeMaps merges two maps and returns the union
func MergeMaps(a, b map[string]string) map[string]string {
if a == nil {
a = map[string]string{}
}
if b == nil {
b = map[string]string{}
}
for k, v := range b {
a[k] = v
}
return a
}

// ToMap converts a slice of env vars to a map of Name and value
func ToMap(envs []corev1.EnvVar) map[string]string {
newMap := make(map[string]string)
Expand Down
22 changes: 16 additions & 6 deletions pkg/apis/minio.min.io/v2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ type TenantSpec struct {
ServiceMetadata *ServiceMetadata `json:"serviceMetadata,omitempty"`
// *Optional* +
//
// Specify custom labels and annotations to append to the MinIO statefulsets.
// Specify custom labels and annotations to append to all pool statefulsets and pods.
// +optional
StatefulSetMetadata *StatefulSetMetadata `json:"statefulSetMetadata,omitempty"`
PoolsMetadata *PoolsMetadata `json:"poolsMetadata,omitempty"`
// *Optional* +
//
// An array of https://kubernetes.io/docs/concepts/configuration/secret/[Kubernetes opaque secrets] to use for generating MinIO users during tenant provisioning. +
Expand Down Expand Up @@ -400,18 +400,28 @@ type ServiceMetadata struct {
// If provided, append these annotations to the Console service
// +optional
ConsoleServiceAnnotations map[string]string `json:"consoleServiceAnnotations,omitempty"`
// *Optional* +
//
// If provided, append these labels to the KES service
// +optional
KESServiceLabels map[string]string `json:"kesServiceLabels,omitempty"`
// *Optional* +
//
// If provided, append these annotations to the KES service
// +optional
KESServiceAnnotations map[string]string `json:"kesServiceAnnotations,omitempty"`
}

// StatefulSetMetadata (`statefulSetMetadata`) defines custom labels and annotations for the MinIO stateful sets. +
type StatefulSetMetadata struct {
// PoolsMetadata (`poolsMetadata`) defines custom labels and annotations for the MinIO pool stateful sets / pods. +
type PoolsMetadata struct {
// *Optional* +
//
// If provided, append these labels to the MinIO statefulset
// If provided, append these labels to the MinIO statefulset / pods
// +optional
Labels map[string]string `json:"labels,omitempty"`
// *Optional* +
//
// If provided, append these annotations to the MinIO statefulset
// If provided, append these annotations to the MinIO statefulset / pods
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
Expand Down
80 changes: 47 additions & 33 deletions pkg/apis/minio.min.io/v2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fe4a452

Please sign in to comment.