mirror of
https://github.com/bitnami/charts.git
synced 2026-02-27 15:18:37 +08:00
* [template] Add commonLabels to pod templates --------- Signed-off-by: Fran Mulero <fmulero@vmware.com>
181 lines
11 KiB
YAML
181 lines
11 KiB
YAML
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "common.names.fullname" . }}
|
|
namespace: {{ include "common.names.namespace" . | quote }}
|
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
|
app.kubernetes.io/component: %%COMPONENT_NAME%%
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.commonAnnotations }}
|
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if not .Values.%%MAIN_OBJECT_BLOCK%%.autoscaling.enabled }}
|
|
replicas: {{ .Values.%%MAIN_OBJECT_BLOCK%%.replicaCount }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.updateStrategy }}
|
|
strategy: {{- toYaml .Values.%%MAIN_OBJECT_BLOCK%%.updateStrategy | nindent 4 }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
|
app.kubernetes.io/component: %%COMPONENT_NAME%%
|
|
template:
|
|
metadata:
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.podAnnotations }}
|
|
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.podAnnotations "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
|
app.kubernetes.io/component: %%COMPONENT_NAME%%
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.podLabels }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.podLabels "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
serviceAccountName: {{ template "%%TEMPLATE_NAME%%.serviceAccountName" . }}
|
|
{{- include "%%TEMPLATE_NAME%%.imagePullSecrets" . | nindent 6 }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.hostAliases }}
|
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.hostAliases "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.affinity }}
|
|
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.affinity "context" $) | nindent 8 }}
|
|
{{- else }}
|
|
affinity:
|
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.%%MAIN_OBJECT_BLOCK%%.podAffinityPreset "component" "%%COMPONENT_NAME%%" "context" $) | nindent 10 }}
|
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.%%MAIN_OBJECT_BLOCK%%.podAntiAffinityPreset "component" "%%COMPONENT_NAME%%" "context" $) | nindent 10 }}
|
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.%%MAIN_OBJECT_BLOCK%%.nodeAffinityPreset.type "key" .Values.%%MAIN_OBJECT_BLOCK%%.nodeAffinityPreset.key "values" .Values.%%MAIN_OBJECT_BLOCK%%.nodeAffinityPreset.values) | nindent 10 }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.nodeSelector }}
|
|
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.nodeSelector "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.tolerations }}
|
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.tolerations "context" .) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.priorityClassName }}
|
|
priorityClassName: {{ .Values.%%MAIN_OBJECT_BLOCK%%.priorityClassName | quote }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.schedulerName }}
|
|
schedulerName: {{ .Values.%%MAIN_OBJECT_BLOCK%%.schedulerName | quote }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.topologySpreadConstraints }}
|
|
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.topologySpreadConstraints "context" .) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.podSecurityContext.enabled }}
|
|
securityContext: {{- omit .Values.%%MAIN_OBJECT_BLOCK%%.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.terminationGracePeriodSeconds }}
|
|
terminationGracePeriodSeconds: {{ .Values.%%MAIN_OBJECT_BLOCK%%.terminationGracePeriodSeconds }}
|
|
{{- end }}
|
|
initContainers:
|
|
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
|
- name: volume-permissions
|
|
image: {{ include "%%TEMPLATE_NAME%%.volumePermissions.image" . }}
|
|
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
|
command:
|
|
- %%commands%%
|
|
securityContext: {{- include "common.tplvalues.render" (dict "value" .Values.volumePermissions.containerSecurityContext "context" $) | nindent 12 }}
|
|
{{- if .Values.volumePermissions.resources }}
|
|
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: foo
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
{{- if .Values.persistence.subPath }}
|
|
subPath: {{ .Values.persistence.subPath }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.initContainers }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.initContainers "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: %%CONTAINER_NAME%%
|
|
image: {{ template "%%TEMPLATE_NAME%%.image" . }}
|
|
imagePullPolicy: {{ .Values.%%MAIN_OBJECT_BLOCK%%.image.pullPolicy }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.containerSecurityContext.enabled }}
|
|
securityContext: {{- omit .Values.%%MAIN_OBJECT_BLOCK%%.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.diagnosticMode.enabled }}
|
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
|
{{- else if .Values.%%MAIN_OBJECT_BLOCK%%.command }}
|
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.command "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.diagnosticMode.enabled }}
|
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
|
{{- else if .Values.%%MAIN_OBJECT_BLOCK%%.args }}
|
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.args "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
- name: BITNAMI_DEBUG
|
|
value: {{ ternary "true" "false" (or .Values.%%MAIN_OBJECT_BLOCK%%.image.debug .Values.diagnosticMode.enabled) | quote }}
|
|
- name: foo
|
|
value: bar
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.extraEnvVars }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.extraEnvVars "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
envFrom:
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.extraEnvVarsCM }}
|
|
- configMapRef:
|
|
name: {{ include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.extraEnvVarsCM "context" $) }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.extraEnvVarsSecret }}
|
|
- secretRef:
|
|
name: {{ include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.extraEnvVarsSecret "context" $) }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.resources }}
|
|
resources: {{- toYaml .Values.%%MAIN_OBJECT_BLOCK%%.resources | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.%%MAIN_OBJECT_BLOCK%%.containerPorts.http }}
|
|
- name: https
|
|
containerPort: {{ .Values.%%MAIN_OBJECT_BLOCK%%.containerPorts.https }}
|
|
{{- if not .Values.diagnosticMode.enabled }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.customLivenessProbe }}
|
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.customLivenessProbe "context" $) | nindent 12 }}
|
|
{{- else if .Values.%%MAIN_OBJECT_BLOCK%%.livenessProbe.enabled }}
|
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.%%MAIN_OBJECT_BLOCK%%.livenessProbe "enabled") "context" $) | nindent 12 }}
|
|
%%httpGet || command || etc%%
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.customReadinessProbe }}
|
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.customReadinessProbe "context" $) | nindent 12 }}
|
|
{{- else if .Values.%%MAIN_OBJECT_BLOCK%%.readinessProbe.enabled }}
|
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.%%MAIN_OBJECT_BLOCK%%.readinessProbe "enabled") "context" $) | nindent 12 }}
|
|
%%httpGet || command || etc%%
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.customStartupProbe }}
|
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.customStartupProbe "context" $) | nindent 12 }}
|
|
{{- else if .Values.%%MAIN_OBJECT_BLOCK%%.startupProbe.enabled }}
|
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.%%MAIN_OBJECT_BLOCK%%.startupProbe "enabled") "context" $) | nindent 12 }}
|
|
%%httpGet || command || etc%%
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.lifecycleHooks }}
|
|
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.lifecycleHooks "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: foo
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
{{- if .Values.persistence.subPath }}
|
|
subPath: {{ .Values.persistence.subPath }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.extraVolumeMounts }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.extraVolumeMounts "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.sidecars }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.sidecars "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: foo
|
|
{{- if .Values.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ default (include "common.names.fullname" .) .Values.persistence.existingClaim }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.extraVolumes }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.%%MAIN_OBJECT_BLOCK%%.extraVolumes "context" $) | nindent 8 }}
|
|
{{- end }}
|