Skip to content

Commit

Permalink
[bitnami/template] allow specific annotations for controllers (bitnam…
Browse files Browse the repository at this point in the history
…i#21010)

* [bitnami/template] allow specific annotations for controllers
Signed-off-by: Alexey Grevtsev <[email protected]>

* Update template/CHART_NAME/templates/daemonset.yaml
  • Loading branch information
agrevtsev authored Nov 22, 2023
1 parent 60d7299 commit 4e31af3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
5 changes: 3 additions & 2 deletions template/CHART_NAME/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ metadata:
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- if or .Values.%%MAIN_OBJECT_BLOCK%%.daemonsetAnnotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.daemonsetAnnotations .Values.commonAnnotations "context" .) | fromYaml }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.updateStrategy }}
Expand Down
5 changes: 3 additions & 2 deletions template/CHART_NAME/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ metadata:
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- if or .Values.%%MAIN_OBJECT_BLOCK%%.deploymentAnnotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.deploymentAnnotations .Values.commonAnnotations "context" .) | fromYaml }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.%%MAIN_OBJECT_BLOCK%%.autoscaling.enabled }}
Expand Down
5 changes: 3 additions & 2 deletions template/CHART_NAME/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ metadata:
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- if or .Values.%%MAIN_OBJECT_BLOCK%%.statefulsetAnnotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.statefulsetAnnotations .Values.commonAnnotations "context" .) | fromYaml }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.autoscaling.enabled }}
Expand Down
12 changes: 12 additions & 0 deletions template/CHART_NAME/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ diagnosticMode:
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
##
hostAliases: []
## @param %%MAIN_OBJECT_BLOCK%%.daemonsetAnnotations Annotations for %%MAIN_CONTAINER_NAME%% daemonset
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
daemonsetAnnotations: {}
## @param %%MAIN_OBJECT_BLOCK%%.deploymentAnnotations Annotations for %%MAIN_CONTAINER_NAME%% deployment
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
deploymentAnnotations: {}
## @param %%MAIN_OBJECT_BLOCK%%.statefulsetAnnotations Annotations for %%MAIN_CONTAINER_NAME%% statefulset
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
statefulsetAnnotations: {}
## @param %%MAIN_OBJECT_BLOCK%%.podLabels Extra labels for %%MAIN_CONTAINER_NAME%% pods
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
##
Expand Down
3 changes: 3 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Some of the items that need to be implemented are:
- affinity
- nodeSelector
- tolerations (that would override the default one)
- daemonsetAnnotations
- deploymentAnnotations
- statefulsetAnnotations
- podAnnotations
- priorityClassName
- lifecycleHooks
Expand Down

0 comments on commit 4e31af3

Please sign in to comment.