diff --git a/charts/eks/templates/api-deployment.yaml b/charts/eks/templates/api-deployment.yaml index aefc6b450..bc66d2bca 100644 --- a/charts/eks/templates/api-deployment.yaml +++ b/charts/eks/templates/api-deployment.yaml @@ -12,9 +12,10 @@ metadata: {{- if .Values.api.labels }} {{ toYaml .Values.api.labels | indent 4 }} {{- end }} - {{- if .Values.api.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.api.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.api.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: replicas: {{ .Values.api.replicas }} diff --git a/charts/eks/templates/controller-deployment.yaml b/charts/eks/templates/controller-deployment.yaml index b952b35fa..a6771d71c 100644 --- a/charts/eks/templates/controller-deployment.yaml +++ b/charts/eks/templates/controller-deployment.yaml @@ -12,9 +12,10 @@ metadata: {{- if .Values.controller.labels }} {{ toYaml .Values.controller.labels | indent 4 }} {{- end }} - {{- if .Values.controller.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.controller.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.controller.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: replicas: {{ .Values.controller.replicas }} diff --git a/charts/eks/templates/coredns.yaml b/charts/eks/templates/coredns.yaml index 24430777b..4a72e7f9f 100644 --- a/charts/eks/templates/coredns.yaml +++ b/charts/eks/templates/coredns.yaml @@ -3,6 +3,10 @@ kind: ConfigMap metadata: name: custom-deployments namespace: {{ .Release.Namespace }} + {{- if .Values.globalAnnotations}} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4}} + {{- end}} data: {{- if .Values.coredns.manifests }} coredns.yaml: |- diff --git a/charts/eks/templates/daemonset-hostpath-mapper.yaml b/charts/eks/templates/daemonset-hostpath-mapper.yaml index 78b7a89d4..11e22e5cb 100644 --- a/charts/eks/templates/daemonset-hostpath-mapper.yaml +++ b/charts/eks/templates/daemonset-hostpath-mapper.yaml @@ -17,9 +17,10 @@ metadata: {{- if .Values.labels }} {{ toYaml .Values.labels | indent 4 }} {{- end }} - {{- if .Values.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: {{- if .Values.hostpathMapper.dev }} diff --git a/charts/eks/templates/etcd-statefulset.yaml b/charts/eks/templates/etcd-statefulset.yaml index 4a03eb205..79c0b6333 100644 --- a/charts/eks/templates/etcd-statefulset.yaml +++ b/charts/eks/templates/etcd-statefulset.yaml @@ -12,9 +12,10 @@ metadata: {{- if .Values.etcd.labels }} {{ toYaml .Values.etcd.labels | indent 4 }} {{- end }} - {{- if .Values.etcd.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.etcd.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.etcd.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: serviceName: {{ .Release.Name }}-etcd-headless diff --git a/charts/eks/templates/ingress.yaml b/charts/eks/templates/ingress.yaml index 0705358bb..3c833d5ce 100644 --- a/charts/eks/templates/ingress.yaml +++ b/charts/eks/templates/ingress.yaml @@ -2,9 +2,10 @@ apiVersion: {{ .Values.ingress.apiVersion }} kind: Ingress metadata: - {{- if .Values.ingress.annotations }} +{{- $annotations := merge .Values.ingress.annotations .Values.globalAnnotations }} + {{- if $annotations }} annotations: - {{- toYaml .Values.ingress.annotations | nindent 4 }} + {{- toYaml $annotations | nindent 4 }} {{- end }} name: {{ .Release.Name }} namespace: {{ .Release.Namespace }} diff --git a/charts/eks/templates/init-configmap.yaml b/charts/eks/templates/init-configmap.yaml index d68a13a4e..9f89a6bb9 100644 --- a/charts/eks/templates/init-configmap.yaml +++ b/charts/eks/templates/init-configmap.yaml @@ -9,6 +9,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations}} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} data: manifests: |- {{ .Values.init.manifests | nindent 4 | trim }} diff --git a/charts/eks/templates/limitrange.yaml b/charts/eks/templates/limitrange.yaml index 235f2cd3e..ed219d063 100644 --- a/charts/eks/templates/limitrange.yaml +++ b/charts/eks/templates/limitrange.yaml @@ -4,6 +4,10 @@ kind: LimitRange metadata: name: {{ .Release.Name }}-limit-range namespace: {{ .Values.isolation.namespace | default .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: limits: - default: diff --git a/charts/eks/templates/networkpolicy.yaml b/charts/eks/templates/networkpolicy.yaml index c932065e0..81886898b 100644 --- a/charts/eks/templates/networkpolicy.yaml +++ b/charts/eks/templates/networkpolicy.yaml @@ -4,6 +4,10 @@ kind: NetworkPolicy metadata: name: {{ .Release.Name }}-workloads namespace: {{ .Values.isolation.namespace | default .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: podSelector: matchLabels: @@ -43,6 +47,10 @@ kind: NetworkPolicy metadata: name: {{ .Release.Name }}-control-plane namespace: {{ .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: podSelector: matchLabels: diff --git a/charts/eks/templates/pre-install-hook-job-role.yaml b/charts/eks/templates/pre-install-hook-job-role.yaml index d7fbf05a5..d6c631530 100644 --- a/charts/eks/templates/pre-install-hook-job-role.yaml +++ b/charts/eks/templates/pre-install-hook-job-role.yaml @@ -5,9 +5,12 @@ metadata: name: {{ .Release.Name }}-job namespace: {{ .Release.Namespace }} annotations: + {{- if .Values.globalAnnotations }} +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} "helm.sh/hook": pre-install "helm.sh/hook-weight": "3" - "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded rules: - apiGroups: [""] resources: ["secrets", "configmaps","services"] diff --git a/charts/eks/templates/pre-install-hook-job-rolebinding.yaml b/charts/eks/templates/pre-install-hook-job-rolebinding.yaml index 795957131..a3decf307 100644 --- a/charts/eks/templates/pre-install-hook-job-rolebinding.yaml +++ b/charts/eks/templates/pre-install-hook-job-rolebinding.yaml @@ -5,6 +5,9 @@ metadata: name: {{ .Release.Name }}-job namespace: {{ .Release.Namespace }} annotations: + {{- if .Values.globalAnnotations}} +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} "helm.sh/hook": pre-install "helm.sh/hook-weight": "3" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded diff --git a/charts/eks/templates/pre-install-hook-job-serviceaccount.yaml b/charts/eks/templates/pre-install-hook-job-serviceaccount.yaml index e32d53c4b..6b92a2294 100644 --- a/charts/eks/templates/pre-install-hook-job-serviceaccount.yaml +++ b/charts/eks/templates/pre-install-hook-job-serviceaccount.yaml @@ -5,6 +5,9 @@ metadata: name: {{ .Release.Name }}-job namespace: {{ .Release.Namespace }} annotations: + {{- if .Values.globalAnnotations}} +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} "helm.sh/hook": pre-install "helm.sh/hook-weight": "3" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded diff --git a/charts/eks/templates/pre-install-hook-job.yaml b/charts/eks/templates/pre-install-hook-job.yaml index 84716740e..9a0a2e013 100644 --- a/charts/eks/templates/pre-install-hook-job.yaml +++ b/charts/eks/templates/pre-install-hook-job.yaml @@ -5,6 +5,9 @@ metadata: name: {{ .Release.Name }}-job namespace: {{ .Release.Namespace }} annotations: + {{- if .Values.globalAnnotations}} +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} "helm.sh/hook": pre-install "helm.sh/hook-weight": "3" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded diff --git a/charts/eks/templates/resourcequota.yaml b/charts/eks/templates/resourcequota.yaml index 21994fb15..b19d89fff 100644 --- a/charts/eks/templates/resourcequota.yaml +++ b/charts/eks/templates/resourcequota.yaml @@ -4,6 +4,10 @@ kind: ResourceQuota metadata: name: {{ .Release.Name }}-quota namespace: {{ .Values.isolation.namespace | default .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: hard: {{- range $key, $val := .Values.isolation.resourceQuota.quota }} diff --git a/charts/eks/templates/serviceaccount.yaml b/charts/eks/templates/serviceaccount.yaml index 14a522afe..504998037 100644 --- a/charts/eks/templates/serviceaccount.yaml +++ b/charts/eks/templates/serviceaccount.yaml @@ -9,6 +9,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} {{- if .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} diff --git a/charts/eks/templates/syncer-deployment.yaml b/charts/eks/templates/syncer-deployment.yaml index a742c049b..cecde63c5 100644 --- a/charts/eks/templates/syncer-deployment.yaml +++ b/charts/eks/templates/syncer-deployment.yaml @@ -11,9 +11,10 @@ metadata: {{- if .Values.syncer.labels }} {{ toYaml .Values.syncer.labels | indent 4 }} {{- end }} - {{- if .Values.syncer.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.syncer.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.syncer.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: replicas: {{ .Values.syncer.replicas }} diff --git a/charts/eks/templates/workloadserviceaccount.yaml b/charts/eks/templates/workloadserviceaccount.yaml index 0afaeb907..ce0e3d03e 100644 --- a/charts/eks/templates/workloadserviceaccount.yaml +++ b/charts/eks/templates/workloadserviceaccount.yaml @@ -8,6 +8,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} {{- if .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} diff --git a/charts/k0s/templates/coredns.yaml b/charts/k0s/templates/coredns.yaml index 29b9c03fc..c39add846 100644 --- a/charts/k0s/templates/coredns.yaml +++ b/charts/k0s/templates/coredns.yaml @@ -4,6 +4,10 @@ kind: ConfigMap metadata: name: {{ .Release.Name }}-coredns namespace: {{ .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} data: {{- if .Values.coredns.manifests }} coredns.yaml: |- diff --git a/charts/k0s/templates/daemonset-hostpath-mapper.yaml b/charts/k0s/templates/daemonset-hostpath-mapper.yaml index 78b7a89d4..11e22e5cb 100644 --- a/charts/k0s/templates/daemonset-hostpath-mapper.yaml +++ b/charts/k0s/templates/daemonset-hostpath-mapper.yaml @@ -17,9 +17,10 @@ metadata: {{- if .Values.labels }} {{ toYaml .Values.labels | indent 4 }} {{- end }} - {{- if .Values.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: {{- if .Values.hostpathMapper.dev }} diff --git a/charts/k0s/templates/ingress.yaml b/charts/k0s/templates/ingress.yaml index 0705358bb..b47f2b8e0 100644 --- a/charts/k0s/templates/ingress.yaml +++ b/charts/k0s/templates/ingress.yaml @@ -2,9 +2,10 @@ apiVersion: {{ .Values.ingress.apiVersion }} kind: Ingress metadata: - {{- if .Values.ingress.annotations }} + {{- $annotations := merge .Values.ingress.annotations .Values.globalAnnotations }} + {{- if $annotations }} annotations: - {{- toYaml .Values.ingress.annotations | nindent 4 }} + {{- toYaml $annotations | nindent 4 }} {{- end }} name: {{ .Release.Name }} namespace: {{ .Release.Namespace }} diff --git a/charts/k0s/templates/init-configmap.yaml b/charts/k0s/templates/init-configmap.yaml index d68a13a4e..f80f74c2c 100644 --- a/charts/k0s/templates/init-configmap.yaml +++ b/charts/k0s/templates/init-configmap.yaml @@ -9,6 +9,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} data: manifests: |- {{ .Values.init.manifests | nindent 4 | trim }} diff --git a/charts/k0s/templates/limitrange.yaml b/charts/k0s/templates/limitrange.yaml index 235f2cd3e..ed219d063 100644 --- a/charts/k0s/templates/limitrange.yaml +++ b/charts/k0s/templates/limitrange.yaml @@ -4,6 +4,10 @@ kind: LimitRange metadata: name: {{ .Release.Name }}-limit-range namespace: {{ .Values.isolation.namespace | default .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: limits: - default: diff --git a/charts/k0s/templates/resourcequota.yaml b/charts/k0s/templates/resourcequota.yaml index 21994fb15..b19d89fff 100644 --- a/charts/k0s/templates/resourcequota.yaml +++ b/charts/k0s/templates/resourcequota.yaml @@ -4,6 +4,10 @@ kind: ResourceQuota metadata: name: {{ .Release.Name }}-quota namespace: {{ .Values.isolation.namespace | default .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: hard: {{- range $key, $val := .Values.isolation.resourceQuota.quota }} diff --git a/charts/k0s/templates/secret.yaml b/charts/k0s/templates/secret.yaml index 7d81cbb05..b01920fff 100644 --- a/charts/k0s/templates/secret.yaml +++ b/charts/k0s/templates/secret.yaml @@ -8,6 +8,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations}} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} type: Opaque stringData: {{- if .Values.serviceCIDR }} diff --git a/charts/k0s/templates/serviceaccount.yaml b/charts/k0s/templates/serviceaccount.yaml index 14a522afe..504998037 100644 --- a/charts/k0s/templates/serviceaccount.yaml +++ b/charts/k0s/templates/serviceaccount.yaml @@ -9,6 +9,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} {{- if .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} diff --git a/charts/k0s/templates/statefulset.yaml b/charts/k0s/templates/statefulset.yaml index a926cf3b0..08f65116c 100644 --- a/charts/k0s/templates/statefulset.yaml +++ b/charts/k0s/templates/statefulset.yaml @@ -11,9 +11,10 @@ metadata: {{- if .Values.labels }} {{ toYaml .Values.labels | indent 4 }} {{- end }} - {{- if .Values.annotations }} +{{- $annotations := merge .Values.annotations .Values.globalAnnotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: serviceName: {{ .Release.Name }}-headless diff --git a/charts/k0s/templates/workloadserviceaccount.yaml b/charts/k0s/templates/workloadserviceaccount.yaml index 0afaeb907..ce0e3d03e 100644 --- a/charts/k0s/templates/workloadserviceaccount.yaml +++ b/charts/k0s/templates/workloadserviceaccount.yaml @@ -8,6 +8,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} {{- if .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} diff --git a/charts/k8s/templates/controller-deployment.yaml b/charts/k8s/templates/controller-deployment.yaml index 72ea49c85..04ff10a70 100644 --- a/charts/k8s/templates/controller-deployment.yaml +++ b/charts/k8s/templates/controller-deployment.yaml @@ -12,9 +12,10 @@ metadata: {{- if .Values.controller.labels }} {{ toYaml .Values.controller.labels | indent 4 }} {{- end }} - {{- if .Values.controller.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.controller.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.controller.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: replicas: {{ .Values.controller.replicas }} diff --git a/charts/k8s/templates/coredns.yaml b/charts/k8s/templates/coredns.yaml index dc5085bd2..c66eaefc4 100644 --- a/charts/k8s/templates/coredns.yaml +++ b/charts/k8s/templates/coredns.yaml @@ -4,6 +4,10 @@ kind: ConfigMap metadata: name: {{ .Release.Name }}-coredns namespace: {{ .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} data: {{- if .Values.coredns.manifests }} coredns.yaml: |- diff --git a/charts/k8s/templates/daemonset-hostpath-mapper.yaml b/charts/k8s/templates/daemonset-hostpath-mapper.yaml index 78b7a89d4..11e22e5cb 100644 --- a/charts/k8s/templates/daemonset-hostpath-mapper.yaml +++ b/charts/k8s/templates/daemonset-hostpath-mapper.yaml @@ -17,9 +17,10 @@ metadata: {{- if .Values.labels }} {{ toYaml .Values.labels | indent 4 }} {{- end }} - {{- if .Values.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: {{- if .Values.hostpathMapper.dev }} diff --git a/charts/k8s/templates/etcd-statefulset.yaml b/charts/k8s/templates/etcd-statefulset.yaml index 4c83de5d6..8fdf7dc4b 100644 --- a/charts/k8s/templates/etcd-statefulset.yaml +++ b/charts/k8s/templates/etcd-statefulset.yaml @@ -12,9 +12,10 @@ metadata: {{- if .Values.etcd.labels }} {{ toYaml .Values.etcd.labels | indent 4 }} {{- end }} - {{- if .Values.etcd.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.etcd.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.etcd.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: serviceName: {{ .Release.Name }}-etcd-headless diff --git a/charts/k8s/templates/ingress.yaml b/charts/k8s/templates/ingress.yaml index 0705358bb..08260a900 100644 --- a/charts/k8s/templates/ingress.yaml +++ b/charts/k8s/templates/ingress.yaml @@ -2,9 +2,10 @@ apiVersion: {{ .Values.ingress.apiVersion }} kind: Ingress metadata: - {{- if .Values.ingress.annotations }} + {{- $annotations := merge .Values.ingress.annotations .Values.globalAnnotations }} + {{- if $annotations }} annotations: - {{- toYaml .Values.ingress.annotations | nindent 4 }} + {{ toYaml $annotations | nindent 4 }} {{- end }} name: {{ .Release.Name }} namespace: {{ .Release.Namespace }} @@ -23,4 +24,4 @@ spec: name: https path: / pathType: {{ .Values.ingress.pathType }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/k8s/templates/init-configmap.yaml b/charts/k8s/templates/init-configmap.yaml index d68a13a4e..f80f74c2c 100644 --- a/charts/k8s/templates/init-configmap.yaml +++ b/charts/k8s/templates/init-configmap.yaml @@ -9,6 +9,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} data: manifests: |- {{ .Values.init.manifests | nindent 4 | trim }} diff --git a/charts/k8s/templates/limitrange.yaml b/charts/k8s/templates/limitrange.yaml index 235f2cd3e..ed219d063 100644 --- a/charts/k8s/templates/limitrange.yaml +++ b/charts/k8s/templates/limitrange.yaml @@ -4,6 +4,10 @@ kind: LimitRange metadata: name: {{ .Release.Name }}-limit-range namespace: {{ .Values.isolation.namespace | default .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: limits: - default: diff --git a/charts/k8s/templates/networkpolicy.yaml b/charts/k8s/templates/networkpolicy.yaml index c932065e0..81886898b 100644 --- a/charts/k8s/templates/networkpolicy.yaml +++ b/charts/k8s/templates/networkpolicy.yaml @@ -4,6 +4,10 @@ kind: NetworkPolicy metadata: name: {{ .Release.Name }}-workloads namespace: {{ .Values.isolation.namespace | default .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: podSelector: matchLabels: @@ -43,6 +47,10 @@ kind: NetworkPolicy metadata: name: {{ .Release.Name }}-control-plane namespace: {{ .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: podSelector: matchLabels: diff --git a/charts/k8s/templates/pre-install-hook-job-role.yaml b/charts/k8s/templates/pre-install-hook-job-role.yaml index 31c25479f..b9b3383ec 100644 --- a/charts/k8s/templates/pre-install-hook-job-role.yaml +++ b/charts/k8s/templates/pre-install-hook-job-role.yaml @@ -5,6 +5,9 @@ metadata: name: {{ .Release.Name }}-job namespace: {{ .Release.Namespace }} annotations: + {{- if .Values.globalAnnotations }} +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} "helm.sh/hook": pre-install "helm.sh/hook-weight": "3" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded diff --git a/charts/k8s/templates/pre-install-hook-job-rolebinding.yaml b/charts/k8s/templates/pre-install-hook-job-rolebinding.yaml index 795957131..fcfe57121 100644 --- a/charts/k8s/templates/pre-install-hook-job-rolebinding.yaml +++ b/charts/k8s/templates/pre-install-hook-job-rolebinding.yaml @@ -5,6 +5,9 @@ metadata: name: {{ .Release.Name }}-job namespace: {{ .Release.Namespace }} annotations: + {{- if .Values.globalAnnotations }} +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} "helm.sh/hook": pre-install "helm.sh/hook-weight": "3" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded diff --git a/charts/k8s/templates/pre-install-hook-job-serviceaccount.yaml b/charts/k8s/templates/pre-install-hook-job-serviceaccount.yaml index e32d53c4b..ee16f092a 100644 --- a/charts/k8s/templates/pre-install-hook-job-serviceaccount.yaml +++ b/charts/k8s/templates/pre-install-hook-job-serviceaccount.yaml @@ -5,6 +5,9 @@ metadata: name: {{ .Release.Name }}-job namespace: {{ .Release.Namespace }} annotations: + {{- if .Values.globalAnnotations }} +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} "helm.sh/hook": pre-install "helm.sh/hook-weight": "3" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded diff --git a/charts/k8s/templates/pre-install-hook-job.yaml b/charts/k8s/templates/pre-install-hook-job.yaml index 84716740e..8e23dc1d9 100644 --- a/charts/k8s/templates/pre-install-hook-job.yaml +++ b/charts/k8s/templates/pre-install-hook-job.yaml @@ -5,6 +5,9 @@ metadata: name: {{ .Release.Name }}-job namespace: {{ .Release.Namespace }} annotations: + {{- if .Values.globalAnnotations }} +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} "helm.sh/hook": pre-install "helm.sh/hook-weight": "3" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded diff --git a/charts/k8s/templates/resourcequota.yaml b/charts/k8s/templates/resourcequota.yaml index 21994fb15..b19d89fff 100644 --- a/charts/k8s/templates/resourcequota.yaml +++ b/charts/k8s/templates/resourcequota.yaml @@ -4,6 +4,10 @@ kind: ResourceQuota metadata: name: {{ .Release.Name }}-quota namespace: {{ .Values.isolation.namespace | default .Release.Namespace }} + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} spec: hard: {{- range $key, $val := .Values.isolation.resourceQuota.quota }} diff --git a/charts/k8s/templates/scheduler-deployment.yaml b/charts/k8s/templates/scheduler-deployment.yaml index 63059e9d0..dec2511b0 100644 --- a/charts/k8s/templates/scheduler-deployment.yaml +++ b/charts/k8s/templates/scheduler-deployment.yaml @@ -12,9 +12,10 @@ metadata: {{- if .Values.scheduler.labels }} {{ toYaml .Values.scheduler.labels | indent 4 }} {{- end }} - {{- if .Values.scheduler.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.scheduler.annotations }} + {{- if $annotations }} annotations: -{{ toYaml .Values.scheduler.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: replicas: {{ .Values.scheduler.replicas }} diff --git a/charts/k8s/templates/serviceaccount.yaml b/charts/k8s/templates/serviceaccount.yaml index 14a522afe..504998037 100644 --- a/charts/k8s/templates/serviceaccount.yaml +++ b/charts/k8s/templates/serviceaccount.yaml @@ -9,6 +9,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} {{- if .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }} diff --git a/charts/k8s/templates/syncer-deployment.yaml b/charts/k8s/templates/syncer-deployment.yaml index 5431da81d..d2fa6c361 100644 --- a/charts/k8s/templates/syncer-deployment.yaml +++ b/charts/k8s/templates/syncer-deployment.yaml @@ -11,9 +11,10 @@ metadata: {{- if .Values.syncer.labels }} {{ toYaml .Values.syncer.labels | indent 4 }} {{- end }} - {{- if .Values.syncer.annotations }} + {{- $annotations := merge .Values.globalAnnotations .Values.syncer.annotations }} + {{- if $annotations}} annotations: -{{ toYaml .Values.syncer.annotations | indent 4 }} +{{ toYaml $annotations | indent 4 }} {{- end }} spec: replicas: {{ .Values.syncer.replicas }} diff --git a/charts/k8s/templates/workloadserviceaccount.yaml b/charts/k8s/templates/workloadserviceaccount.yaml index 0afaeb907..ce0e3d03e 100644 --- a/charts/k8s/templates/workloadserviceaccount.yaml +++ b/charts/k8s/templates/workloadserviceaccount.yaml @@ -8,6 +8,10 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.globalAnnotations }} + annotations: +{{ toYaml .Values.globalAnnotations | indent 4 }} + {{- end }} {{- if .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }}