Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow annotation of all objects created by the eks,8s and k0s charts #16

Open
wants to merge 1 commit into
base: develop_bkp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions charts/eks/templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/eks/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/eks/templates/coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down
5 changes: 3 additions & 2 deletions charts/eks/templates/daemonset-hostpath-mapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/eks/templates/etcd-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions charts/eks/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/eks/templates/init-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/eks/templates/limitrange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions charts/eks/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion charts/eks/templates/pre-install-hook-job-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
3 changes: 3 additions & 0 deletions charts/eks/templates/pre-install-hook-job-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions charts/eks/templates/pre-install-hook-job-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions charts/eks/templates/pre-install-hook-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions charts/eks/templates/resourcequota.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/eks/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/eks/templates/syncer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/eks/templates/workloadserviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/k0s/templates/coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down
5 changes: 3 additions & 2 deletions charts/k0s/templates/daemonset-hostpath-mapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/k0s/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/k0s/templates/init-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/k0s/templates/limitrange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions charts/k0s/templates/resourcequota.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/k0s/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/k0s/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/k0s/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions charts/k0s/templates/workloadserviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/k8s/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/k8s/templates/coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down
5 changes: 3 additions & 2 deletions charts/k8s/templates/daemonset-hostpath-mapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/k8s/templates/etcd-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions charts/k8s/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -23,4 +24,4 @@ spec:
name: https
path: /
pathType: {{ .Values.ingress.pathType }}
{{- end }}
{{- end }}
Loading