From 1933d62fadc018f39068d054c3c4359621da7820 Mon Sep 17 00:00:00 2001 From: Silvester Date: Sun, 16 May 2021 12:44:13 +0300 Subject: [PATCH 1/8] Add common labels to minio Changelog: added --- charts/minio/templates/create-buckets-job.yaml | 1 + charts/minio/templates/ingress.yaml | 1 + charts/minio/templates/minio_deployment.yaml | 2 ++ charts/minio/templates/minio_networkpolicy.yaml | 1 + charts/minio/templates/minio_pvc.yaml | 1 + charts/minio/templates/minio_svc.yaml | 1 + charts/minio/templates/minioconfig_configmap.yaml | 1 + charts/minio/templates/pdb.yaml | 1 + charts/minio/values.yaml | 3 +++ 9 files changed, 12 insertions(+) diff --git a/charts/minio/templates/create-buckets-job.yaml b/charts/minio/templates/create-buckets-job.yaml index f11c010913..76be342d06 100755 --- a/charts/minio/templates/create-buckets-job.yaml +++ b/charts/minio/templates/create-buckets-job.yaml @@ -6,6 +6,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.commonLabels" . | nindent 4 }} spec: activeDeadlineSeconds: 600 template: diff --git a/charts/minio/templates/ingress.yaml b/charts/minio/templates/ingress.yaml index bfc845c9f9..23626ce253 100644 --- a/charts/minio/templates/ingress.yaml +++ b/charts/minio/templates/ingress.yaml @@ -10,6 +10,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.commonLabels" . | nindent 4 }} annotations: kubernetes.io/ingress.class: "{{ template "minio.ingressclass" . }}" kubernetes.io/ingress.provider: nginx diff --git a/charts/minio/templates/minio_deployment.yaml b/charts/minio/templates/minio_deployment.yaml index 830ace8847..e4e3556a80 100755 --- a/charts/minio/templates/minio_deployment.yaml +++ b/charts/minio/templates/minio_deployment.yaml @@ -6,6 +6,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{- include "gitlab.standardLabels" . | nindent 4 }} + {{- include "gitlab.commonLabels" . | nindent 4 }} annotations: {{- include "gitlab.deploymentAnnotations" . | nindent 4 }} spec: @@ -29,6 +30,7 @@ spec: {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 8 }} {{- end }} +{{- include "gitlab.commonLabels" . | nindent 8 }} annotations: {{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }} diff --git a/charts/minio/templates/minio_networkpolicy.yaml b/charts/minio/templates/minio_networkpolicy.yaml index 08cad0d092..6de4584d14 100755 --- a/charts/minio/templates/minio_networkpolicy.yaml +++ b/charts/minio/templates/minio_networkpolicy.yaml @@ -6,6 +6,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.commonLabels" . | nindent 4 }} spec: podSelector: matchLabels: diff --git a/charts/minio/templates/minio_pvc.yaml b/charts/minio/templates/minio_pvc.yaml index b9e73bef5d..f230a43ed9 100755 --- a/charts/minio/templates/minio_pvc.yaml +++ b/charts/minio/templates/minio_pvc.yaml @@ -6,6 +6,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.commonLabels" . | nindent 4 }} spec: accessModes: - {{ .Values.persistence.accessMode | quote }} diff --git a/charts/minio/templates/minio_svc.yaml b/charts/minio/templates/minio_svc.yaml index c2ee0be88b..784aadc49a 100755 --- a/charts/minio/templates/minio_svc.yaml +++ b/charts/minio/templates/minio_svc.yaml @@ -6,6 +6,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.commonLabels" . | nindent 4 }} annotations: {{ include "gitlab.serviceAnnotations" . | indent 4 }} spec: diff --git a/charts/minio/templates/minioconfig_configmap.yaml b/charts/minio/templates/minioconfig_configmap.yaml index e92fcd0c07..35b87e25dc 100755 --- a/charts/minio/templates/minioconfig_configmap.yaml +++ b/charts/minio/templates/minioconfig_configmap.yaml @@ -6,6 +6,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.commonLabels" . | nindent 4 }} data: initialize: |- {{ include (print $.Template.BasePath "/_helper_create_buckets.sh") . | indent 4 }} diff --git a/charts/minio/templates/pdb.yaml b/charts/minio/templates/pdb.yaml index ba02f7d9f5..6ed7568559 100644 --- a/charts/minio/templates/pdb.yaml +++ b/charts/minio/templates/pdb.yaml @@ -6,6 +6,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.commonLabels" . | nindent 4 }} spec: maxUnavailable: {{ .Values.maxUnavailable }} selector: diff --git a/charts/minio/values.yaml b/charts/minio/values.yaml index 96ea7c2a7a..a5ada231bb 100755 --- a/charts/minio/values.yaml +++ b/charts/minio/values.yaml @@ -43,6 +43,9 @@ global: minio: enabled: true +common: + labels: {} + ## Control the InitContainer behaviors. init: image: -- GitLab From 4331a9d841a6f764cc0012cdba1eb325c77102e7 Mon Sep 17 00:00:00 2001 From: Mitchell Nielsen Date: Tue, 18 May 2021 15:51:41 +0000 Subject: [PATCH 2/8] Apply 1 suggestion(s) to 1 file(s) --- charts/minio/templates/create-buckets-job.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/minio/templates/create-buckets-job.yaml b/charts/minio/templates/create-buckets-job.yaml index 76be342d06..3b01fbaad7 100755 --- a/charts/minio/templates/create-buckets-job.yaml +++ b/charts/minio/templates/create-buckets-job.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "minio.createBucketsJobName" . }} namespace: {{ $.Release.Namespace }} labels: -{{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.standardLabels" . | nindent 4 }} {{- include "gitlab.commonLabels" . | nindent 4 }} spec: activeDeadlineSeconds: 600 -- GitLab From 14d41622f13cbdff7f5f9df187f78935eeef926b Mon Sep 17 00:00:00 2001 From: Silvester Date: Wed, 19 May 2021 16:09:53 +0300 Subject: [PATCH 3/8] Update the standard labels --- charts/minio/templates/ingress.yaml | 2 +- charts/minio/templates/minio_networkpolicy.yaml | 2 +- charts/minio/templates/minio_pvc.yaml | 2 +- charts/minio/templates/minio_svc.yaml | 2 +- charts/minio/templates/minioconfig_configmap.yaml | 2 +- charts/minio/templates/pdb.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/minio/templates/ingress.yaml b/charts/minio/templates/ingress.yaml index 23626ce253..9fa619ecdd 100644 --- a/charts/minio/templates/ingress.yaml +++ b/charts/minio/templates/ingress.yaml @@ -9,7 +9,7 @@ metadata: name: {{ template "minio.fullname" . }} namespace: {{ $.Release.Namespace }} labels: -{{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.standardLabels" . | nindent 4 }} {{- include "gitlab.commonLabels" . | nindent 4 }} annotations: kubernetes.io/ingress.class: "{{ template "minio.ingressclass" . }}" diff --git a/charts/minio/templates/minio_networkpolicy.yaml b/charts/minio/templates/minio_networkpolicy.yaml index 6de4584d14..7d6ed35163 100755 --- a/charts/minio/templates/minio_networkpolicy.yaml +++ b/charts/minio/templates/minio_networkpolicy.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "minio.fullname" . }} namespace: {{ $.Release.Namespace }} labels: -{{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.standardLabels" . | nindent 4 }} {{- include "gitlab.commonLabels" . | nindent 4 }} spec: podSelector: diff --git a/charts/minio/templates/minio_pvc.yaml b/charts/minio/templates/minio_pvc.yaml index f230a43ed9..bfbc0f4a17 100755 --- a/charts/minio/templates/minio_pvc.yaml +++ b/charts/minio/templates/minio_pvc.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "minio.fullname" . }} namespace: {{ $.Release.Namespace }} labels: -{{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.standardLabels" . | nindent 4 }} {{- include "gitlab.commonLabels" . | nindent 4 }} spec: accessModes: diff --git a/charts/minio/templates/minio_svc.yaml b/charts/minio/templates/minio_svc.yaml index 784aadc49a..0e74543457 100755 --- a/charts/minio/templates/minio_svc.yaml +++ b/charts/minio/templates/minio_svc.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "minio.fullname" . }}-svc namespace: {{ $.Release.Namespace }} labels: -{{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.standardLabels" . | nindent 4 }} {{- include "gitlab.commonLabels" . | nindent 4 }} annotations: {{ include "gitlab.serviceAnnotations" . | indent 4 }} diff --git a/charts/minio/templates/minioconfig_configmap.yaml b/charts/minio/templates/minioconfig_configmap.yaml index 35b87e25dc..b8bb02b801 100755 --- a/charts/minio/templates/minioconfig_configmap.yaml +++ b/charts/minio/templates/minioconfig_configmap.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "minio.fullname" . }}-config-cm namespace: {{ $.Release.Namespace }} labels: -{{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.standardLabels" . | nindent 4 }} {{- include "gitlab.commonLabels" . | nindent 4 }} data: initialize: |- diff --git a/charts/minio/templates/pdb.yaml b/charts/minio/templates/pdb.yaml index 6ed7568559..cd4047805d 100644 --- a/charts/minio/templates/pdb.yaml +++ b/charts/minio/templates/pdb.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "minio.fullname" . }}-v1 namespace: {{ $.Release.Namespace }} labels: -{{ include "gitlab.standardLabels" . | indent 4 }} +{{- include "gitlab.standardLabels" . | nindent 4 }} {{- include "gitlab.commonLabels" . | nindent 4 }} spec: maxUnavailable: {{ .Values.maxUnavailable }} -- GitLab From d1257daaf6c0ae71bd760abff9b5188bba85cccf Mon Sep 17 00:00:00 2001 From: Silvester Date: Wed, 19 May 2021 16:49:21 +0300 Subject: [PATCH 4/8] Add labels to job template --- charts/minio/templates/create-buckets-job.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/minio/templates/create-buckets-job.yaml b/charts/minio/templates/create-buckets-job.yaml index 3b01fbaad7..0f8c0070a6 100755 --- a/charts/minio/templates/create-buckets-job.yaml +++ b/charts/minio/templates/create-buckets-job.yaml @@ -15,6 +15,7 @@ spec: app: {{ template "minio.name" . }} release: {{ .Release.Name }} component: create-buckets + {{- include "gitlab.commonLabels" . | nindent 8 }} spec: restartPolicy: OnFailure {{- include "gitlab.nodeSelector" . | nindent 6 }} -- GitLab From 5d5ee208367ecf134c7de39e1eec7e2386f7ff9e Mon Sep 17 00:00:00 2001 From: Mitchell Nielsen Date: Wed, 19 May 2021 14:21:01 +0000 Subject: [PATCH 5/8] Apply 1 suggestion(s) to 1 file(s) --- charts/minio/templates/create-buckets-job.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/minio/templates/create-buckets-job.yaml b/charts/minio/templates/create-buckets-job.yaml index 0f8c0070a6..afda801fcb 100755 --- a/charts/minio/templates/create-buckets-job.yaml +++ b/charts/minio/templates/create-buckets-job.yaml @@ -15,7 +15,9 @@ spec: app: {{ template "minio.name" . }} release: {{ .Release.Name }} component: create-buckets + {{- include "gitlab.standardLabels" . | nindent 8 }} {{- include "gitlab.commonLabels" . | nindent 8 }} + {{- include "gitlab.podLabels" . | nindent 8 }} spec: restartPolicy: OnFailure {{- include "gitlab.nodeSelector" . | nindent 6 }} -- GitLab From 06fd852009941ff3b161908700045ad4576ec768 Mon Sep 17 00:00:00 2001 From: Silvester Date: Wed, 19 May 2021 19:37:10 +0300 Subject: [PATCH 6/8] Use gitlab.podLabels template for minio deployment --- charts/minio/templates/minio_deployment.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/charts/minio/templates/minio_deployment.yaml b/charts/minio/templates/minio_deployment.yaml index e4e3556a80..9ab73f0d56 100755 --- a/charts/minio/templates/minio_deployment.yaml +++ b/charts/minio/templates/minio_deployment.yaml @@ -27,10 +27,9 @@ spec: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" component: app -{{- if .Values.podLabels }} -{{ toYaml .Values.podLabels | indent 8 }} -{{- end }} -{{- include "gitlab.commonLabels" . | nindent 8 }} + {{- include "gitlab.standardLabels" . | nindent 8 }} + {{- include "gitlab.podLabels" . | nindent 8 }} + {{- include "gitlab.commonLabels" . | nindent 8 }} annotations: {{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }} -- GitLab From cab333ec15f8af07a6b7aed0772fa24b695592c6 Mon Sep 17 00:00:00 2001 From: Mitchell Nielsen Date: Thu, 20 May 2021 06:10:10 +0000 Subject: [PATCH 7/8] Apply 1 suggestion(s) to 1 file(s) --- charts/minio/templates/minio_deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/minio/templates/minio_deployment.yaml b/charts/minio/templates/minio_deployment.yaml index 9ab73f0d56..3095593553 100755 --- a/charts/minio/templates/minio_deployment.yaml +++ b/charts/minio/templates/minio_deployment.yaml @@ -28,8 +28,8 @@ spec: heritage: "{{ .Release.Service }}" component: app {{- include "gitlab.standardLabels" . | nindent 8 }} - {{- include "gitlab.podLabels" . | nindent 8 }} {{- include "gitlab.commonLabels" . | nindent 8 }} + {{- include "gitlab.podLabels" . | nindent 8 }} annotations: {{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }} -- GitLab From f0ee5cc5fd174a0253d01aa9748a6ddd71408b01 Mon Sep 17 00:00:00 2001 From: Silvester Wainaina Date: Thu, 20 May 2021 13:40:15 +0000 Subject: [PATCH 8/8] Add common labels documentation --- doc/charts/minio/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/charts/minio/index.md b/doc/charts/minio/index.md index 4a33b501a5..a977bfbff2 100644 --- a/doc/charts/minio/index.md +++ b/doc/charts/minio/index.md @@ -59,6 +59,7 @@ to the `helm install` command using the `--set` flags: | Parameter | Default | Description | | ------------------------------ | ----------------------------- | --------------------------------------- | +| `common.labels` | `{}` | Supplemental labels that are applied to all objects created by this chart. | | `defaultBuckets` | `[{"name": "registry"}]` | MinIO default buckets | | `deployment.strategy` | { `type`: `Recreate` } | Allows one to configure the update strategy utilized by the deployment | | `image` | `minio/minio` | MinIO image | -- GitLab