From 5bd5a76d252421256f8f0d71188985efe1e7b7da Mon Sep 17 00:00:00 2001 From: oldgiova <27446810+oldgiova@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:34:24 +0200 Subject: [PATCH] feat: add resource annotations (#6134) --- k8s/charts/seaweedfs/templates/filer-cert.yaml | 4 ++++ .../seaweedfs/templates/filer-service-client.yaml | 4 ++++ k8s/charts/seaweedfs/templates/filer-service.yaml | 4 ++++ .../seaweedfs/templates/filer-servicemonitor.yaml | 4 ++++ .../seaweedfs/templates/filer-statefulset.yaml | 4 ++++ k8s/charts/seaweedfs/templates/master-cert.yaml | 4 ++++ k8s/charts/seaweedfs/templates/master-configmap.yaml | 4 ++++ k8s/charts/seaweedfs/templates/master-service.yaml | 3 +++ .../seaweedfs/templates/master-servicemonitor.yaml | 4 ++++ .../seaweedfs/templates/master-statefulset.yaml | 4 ++++ k8s/charts/seaweedfs/templates/s3-deployment.yaml | 4 ++++ k8s/charts/seaweedfs/templates/s3-service.yaml | 4 ++++ .../seaweedfs/templates/s3-servicemonitor.yaml | 4 ++++ k8s/charts/seaweedfs/templates/volume-cert.yaml | 4 ++++ k8s/charts/seaweedfs/templates/volume-service.yaml | 4 ++++ .../seaweedfs/templates/volume-servicemonitor.yaml | 4 ++++ .../seaweedfs/templates/volume-statefulset.yaml | 4 ++++ k8s/charts/seaweedfs/values.yaml | 12 ++++++++++++ 18 files changed, 79 insertions(+) diff --git a/k8s/charts/seaweedfs/templates/filer-cert.yaml b/k8s/charts/seaweedfs/templates/filer-cert.yaml index c17815af2..4cb117ae8 100644 --- a/k8s/charts/seaweedfs/templates/filer-cert.yaml +++ b/k8s/charts/seaweedfs/templates/filer-cert.yaml @@ -10,6 +10,10 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: filer + {{- if .Values.filer.annotations }} + annotations: + {{- toYaml .Values.filer.annotations | nindent 4 }} + {{- end }} spec: secretName: {{ template "seaweedfs.name" . }}-filer-cert issuerRef: diff --git a/k8s/charts/seaweedfs/templates/filer-service-client.yaml b/k8s/charts/seaweedfs/templates/filer-service-client.yaml index d7618c4cb..1c32de0ba 100644 --- a/k8s/charts/seaweedfs/templates/filer-service-client.yaml +++ b/k8s/charts/seaweedfs/templates/filer-service-client.yaml @@ -13,6 +13,10 @@ metadata: {{- if .Values.filer.metricsPort }} monitoring: "true" {{- end }} +{{- if .Values.filer.annotations }} + annotations: + {{- toYaml .Values.filer.annotations | nindent 4 }} +{{- end }} spec: clusterIP: None ports: diff --git a/k8s/charts/seaweedfs/templates/filer-service.yaml b/k8s/charts/seaweedfs/templates/filer-service.yaml index ab7e98df8..67436972e 100644 --- a/k8s/charts/seaweedfs/templates/filer-service.yaml +++ b/k8s/charts/seaweedfs/templates/filer-service.yaml @@ -12,6 +12,10 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: filer +{{- if .Values.filer.annotations }} + annotations: + {{- toYaml .Values.filer.annotations | nindent 4 }} +{{- end }} spec: clusterIP: None publishNotReadyAddresses: true diff --git a/k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml index 76c981c1a..e26c04b1f 100644 --- a/k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml @@ -15,6 +15,10 @@ metadata: {{- with .Values.global.monitoring.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} +{{- if .Values.filer.annotations }} + annotations: + {{- toYaml .Values.filer.annotations | nindent 4 }} +{{- end }} spec: endpoints: - interval: 30s diff --git a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml index 657b37cf5..fce27bb9a 100644 --- a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml @@ -10,6 +10,10 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: filer +{{- if .Values.filer.annotations }} + annotations: + {{- toYaml .Values.filer.annotations | nindent 4 }} +{{- end }} spec: serviceName: {{ template "seaweedfs.name" . }}-filer podManagementPolicy: {{ .Values.filer.podManagementPolicy }} diff --git a/k8s/charts/seaweedfs/templates/master-cert.yaml b/k8s/charts/seaweedfs/templates/master-cert.yaml index 47dcaacd3..256785254 100644 --- a/k8s/charts/seaweedfs/templates/master-cert.yaml +++ b/k8s/charts/seaweedfs/templates/master-cert.yaml @@ -10,6 +10,10 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: master +{{- if .Values.master.annotations }} + annotations: + {{- toYaml .Values.master.annotations | nindent 4 }} +{{- end }} spec: secretName: {{ template "seaweedfs.name" . }}-master-cert issuerRef: diff --git a/k8s/charts/seaweedfs/templates/master-configmap.yaml b/k8s/charts/seaweedfs/templates/master-configmap.yaml index 73155e87d..58c676f5e 100644 --- a/k8s/charts/seaweedfs/templates/master-configmap.yaml +++ b/k8s/charts/seaweedfs/templates/master-configmap.yaml @@ -9,6 +9,10 @@ metadata: helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Values.master.annotations }} + annotations: + {{- toYaml .Values.master.annotations | nindent 4 }} +{{- end }} data: master.toml: |- {{ .Values.master.config | nindent 4 }} diff --git a/k8s/charts/seaweedfs/templates/master-service.yaml b/k8s/charts/seaweedfs/templates/master-service.yaml index 9e69f94e5..0086b84c1 100644 --- a/k8s/charts/seaweedfs/templates/master-service.yaml +++ b/k8s/charts/seaweedfs/templates/master-service.yaml @@ -11,6 +11,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} annotations: service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" +{{- if .Values.master.annotations }} + {{- toYaml .Values.master.annotations | nindent 4 }} +{{- end }} spec: clusterIP: None publishNotReadyAddresses: true diff --git a/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml index 81cade2ef..7804e84ae 100644 --- a/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml @@ -15,6 +15,10 @@ metadata: {{- with .Values.global.monitoring.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} +{{- if .Values.master.annotations }} + annotations: + {{- toYaml .Values.master.annotations | nindent 4 }} +{{- end }} spec: endpoints: - interval: 30s diff --git a/k8s/charts/seaweedfs/templates/master-statefulset.yaml b/k8s/charts/seaweedfs/templates/master-statefulset.yaml index ab3a3ca8d..c46d37166 100644 --- a/k8s/charts/seaweedfs/templates/master-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/master-statefulset.yaml @@ -9,6 +9,10 @@ metadata: helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Values.master.annotations }} + annotations: + {{- toYaml .Values.master.annotations | nindent 4 }} +{{- end }} spec: serviceName: {{ template "seaweedfs.name" . }}-master podManagementPolicy: {{ .Values.master.podManagementPolicy }} diff --git a/k8s/charts/seaweedfs/templates/s3-deployment.yaml b/k8s/charts/seaweedfs/templates/s3-deployment.yaml index fdb253b6c..1c989c3fb 100644 --- a/k8s/charts/seaweedfs/templates/s3-deployment.yaml +++ b/k8s/charts/seaweedfs/templates/s3-deployment.yaml @@ -9,6 +9,10 @@ metadata: helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Values.s3.annotations }} + annotations: + {{- toYaml .Values.s3.annotations | nindent 4 }} +{{- end }} spec: replicas: {{ .Values.s3.replicas }} selector: diff --git a/k8s/charts/seaweedfs/templates/s3-service.yaml b/k8s/charts/seaweedfs/templates/s3-service.yaml index 01d79ad74..8afd48654 100644 --- a/k8s/charts/seaweedfs/templates/s3-service.yaml +++ b/k8s/charts/seaweedfs/templates/s3-service.yaml @@ -9,6 +9,10 @@ metadata: app.kubernetes.io/component: s3 helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.s3.annotations }} + annotations: + {{- toYaml .Values.s3.annotations | nindent 4 }} +{{- end }} spec: internalTrafficPolicy: {{ .Values.s3.internalTrafficPolicy | default "Cluster" }} ports: diff --git a/k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml index b47ba8ee6..03d35cd4a 100644 --- a/k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml @@ -15,6 +15,10 @@ metadata: {{- with .Values.global.monitoring.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} +{{- if .Values.s3.annotations }} + annotations: + {{- toYaml .Values.s3.annotations | nindent 4 }} +{{- end }} spec: endpoints: - interval: 30s diff --git a/k8s/charts/seaweedfs/templates/volume-cert.yaml b/k8s/charts/seaweedfs/templates/volume-cert.yaml index 4df63db2c..bd59a676d 100644 --- a/k8s/charts/seaweedfs/templates/volume-cert.yaml +++ b/k8s/charts/seaweedfs/templates/volume-cert.yaml @@ -10,6 +10,10 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: volume +{{- if .Values.volume.annotations }} + annotations: + {{- toYaml .Values.volume.annotations | nindent 4 }} +{{- end }} spec: secretName: {{ template "seaweedfs.name" . }}-volume-cert issuerRef: diff --git a/k8s/charts/seaweedfs/templates/volume-service.yaml b/k8s/charts/seaweedfs/templates/volume-service.yaml index 1205f4fad..f881d27f3 100644 --- a/k8s/charts/seaweedfs/templates/volume-service.yaml +++ b/k8s/charts/seaweedfs/templates/volume-service.yaml @@ -9,6 +9,10 @@ metadata: app.kubernetes.io/component: volume helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.volume.annotations }} + annotations: + {{- toYaml .Values.volume.annotations | nindent 4 }} +{{- end }} spec: clusterIP: None internalTrafficPolicy: {{ .Values.volume.internalTrafficPolicy | default "Cluster" }} diff --git a/k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml index 4aeacc416..8dfa96c97 100644 --- a/k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml @@ -15,6 +15,10 @@ metadata: {{- with .Values.global.monitoring.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} +{{- if .Values.volume.annotations }} + annotations: + {{- toYaml .Values.volume.annotations | nindent 4 }} +{{- end }} spec: endpoints: - interval: 30s diff --git a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml index 5e6fa2999..e915593a5 100644 --- a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml @@ -9,6 +9,10 @@ metadata: helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Values.volume.annotations }} + annotations: + {{- toYaml .Values.volume.annotations | nindent 4 }} +{{- end }} spec: serviceName: {{ template "seaweedfs.name" . }}-volume replicas: {{ .Values.volume.replicas }} diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml index f450b8a84..2470ac111 100644 --- a/k8s/charts/seaweedfs/values.yaml +++ b/k8s/charts/seaweedfs/values.yaml @@ -140,6 +140,9 @@ master: # Annotations to be added to the master pods podAnnotations: {} + # Annotations to be added to the master resources + annotations: {} + ## Set podManagementPolicy podManagementPolicy: Parallel @@ -410,6 +413,9 @@ volume: # Annotations to be added to the volume pods podAnnotations: {} + # Annotations to be added to the volume resources + annotations: {} + ## Set podManagementPolicy podManagementPolicy: Parallel @@ -609,6 +615,9 @@ filer: # Annotations to be added to the filer pods podAnnotations: {} + # Annotations to be added to the filer resource + annotations: {} + ## Set podManagementPolicy podManagementPolicy: Parallel @@ -828,6 +837,9 @@ s3: # Annotations to be added to the s3 pods podAnnotations: {} + # Annotations to be added to the s3 resources + annotations: {} + # Resource requests, limits, etc. for the server cluster placement. This # should map directly to the value of the resources field for a PodSpec, # formatted as a multi-line string. By default no direct resource request