Skip to content

Commit

Permalink
chore: add common labels and annotations to pods
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisingal committed Sep 24, 2024
1 parent 48fbc0d commit e7a5be6
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
20 changes: 14 additions & 6 deletions kafka-topic-creator/helm/templates/kafka-topic-creation-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,31 @@ spec:
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
{{- with .Values.commonPodLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.podAnnotations .Values.commonPodAnnotations }}
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end}}
{{- with .Values.commonPodAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end}}
{{- end}}
{{- end }}
spec:
containers:
- name: topic-creator
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
{{- toYaml .Values.env | nindent 12 }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: configs
mountPath: /opt/kafka
Expand Down
6 changes: 6 additions & 0 deletions kafka-topic-creator/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ securityContext: {}

podLabels: {}

podAnnotations: {}

commonPodLabels: {}

commonPodAnnotations: {}

activeDeadlineSeconds: 600

ttlSecondsAfterFinished: 900
Expand Down
20 changes: 16 additions & 4 deletions kstreams-app-version-checker/helm/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ spec:
{{- with .Values.podLabels}}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.commonPodLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.podAnnotations .Values.commonPodAnnotations }}
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end}}
{{- with .Values.commonPodAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end}}
{{- end }}
spec:
{{- with .Values.podSecurityContext }}
securityContext:
Expand All @@ -29,10 +41,6 @@ spec:
containers:
- name: kstreams-app-version-checker
image: {{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tagOverride }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: NAMESPACE
Expand All @@ -43,6 +51,10 @@ spec:
value: {{ int .Values.waitSeconds | default 360 | quote }}
- name: WORKLOADS
value: "{{ range $workload := .Values.workloads }}{{ $workload.name }},{{ $workload.type }},{{ $workload.container }};{{ end }}"
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
Expand Down
13 changes: 11 additions & 2 deletions kstreams-app-version-checker/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ configMapName: ""
workloads: []

resources: {}
containerSecurityContext: {}

podSecurityContext: {}
podLabels: {}

containerSecurityContext: {}

podLabels: {}

podAnnotations: {}

commonPodLabels: {}

commonPodAnnotations: {}

0 comments on commit e7a5be6

Please sign in to comment.