Files
charts/bitnami/zipkin/templates/deployment.yaml
Miguel Ruiz 4b885c6c54 [bitnami/zipkin] Set usePasswordFiles=true by default (#32123)
* [bitnami/zipkin] Set `usePasswordFiles=true` by default

Signed-off-by: Miguel Ruiz <miguel.ruiz@broadcom.com>

* Update CHANGELOG.md

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

---------

Signed-off-by: Miguel Ruiz <miguel.ruiz@broadcom.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
2025-02-24 15:02:46 +01:00

282 lines
14 KiB
YAML

{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "common.names.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
{{- $labels := include "common.tplvalues.merge" ( dict "values" (list .Values.commonLabels .Values.deploymentLabels) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: zipkin
app.kubernetes.io/part-of: zipkin
{{- if or .Values.deploymentAnnotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.deploymentAnnotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.autoscaling.hpa.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
{{- if .Values.updateStrategy}}
strategy: {{- toYaml .Values.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: zipkin
app.kubernetes.io/part-of: zipkin
template:
metadata:
annotations:
{{- if not .Values.existingConfigmap }}
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- end }}
{{- if and (not .Values.existingSecret) .Values.secretConfigOverrides }}
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.podAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
{{- end }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
app.kubernetes.io/component: zipkin
app.kubernetes.io/part-of: zipkin
spec:
serviceAccountName: {{ template "zipkin.serviceAccountName" . }}
{{- include "zipkin.imagePullSecrets" . | nindent 6 }}
{{- if .Values.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
{{- end }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
{{- if .Values.affinity }}
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "zipkin" "customLabels" $podLabels "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "zipkin" "customLabels" $podLabels "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- end }}
{{- if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName | quote }}
{{- end }}
{{- if .Values.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
initContainers:
{{- if and .Values.defaultInitContainers.waitForCassandra.enabled (eq .Values.storageType "cassandra3") }}
{{- include "zipkin.init-containers.wait-for-cassandra" . | nindent 8 }}
{{- end }}
{{- if and .Values.tls.enabled .Values.defaultInitContainers.initCerts.enabled }}
{{- include "zipkin.init-containers.init-certs" . | nindent 8 }}
{{- end }}
{{- if .Values.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: zipkin
image: {{ include "zipkin.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
{{- else if .Values.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
{{- else }}
command:
- /bin/bash
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else if .Values.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }}
{{- else }}
args:
- -ec
- |
{{- if .Values.usePasswordFiles }}
# We need to load all the secret env vars to the system
for file in $(find /bitnami/zipkin/secrets -type f); do
env_var_name="$(basename $file)"
echo "Exporting $env_var_name"
export $env_var_name="$(< $file)"
done
{{- end }}
exec start-zipkin
{{- end }}
env:
- name: BITNAMI_DEBUG
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
{{- if .Values.javaOpts }}
- name: JAVA_OPTS
value: {{ .Values.javaOpts | quote }}
{{- end }}
{{- if and (eq .Values.storageType "cassandra3") (not .Values.usePasswordFiles) }}
- name: CASSANDRA_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "zipkin.cassandra.secretName" . }}
key: {{ include "zipkin.cassandra.passwordKey" . | quote }}
{{- end }}
{{- if not .Values.usePasswordFiles }}
{{- if or .Values.tls.passwordSecret .Values.tls.password .Values.tls.autoGenerated.enabled .Values.tls.usePemCerts }}
- name: ARMERIA_SSL_KEY_STORE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "zipkin.tls.passwordSecretName" . }}
key: keystore-password
{{- end }}
{{- end }}
{{- if .Values.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "zipkin.configmapName" . }}
{{- if and (not .Values.usePasswordFiles) (or .Values.secretConfigOverrides .Values.existingSecret) }}
- secretRef:
name: {{ include "zipkin.secretName" . }}
{{- end }}
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
{{- end }}
{{- if .Values.resources }}
resources: {{ toYaml .Values.resources | nindent 12 }}
{{- else if ne .Values.resourcesPreset "none" }}
resources: {{- include "common.resources.preset" (dict "type" .Values.resourcesPreset) | nindent 12 }}
{{- end }}
ports:
- name: {{ ternary "https" "http" .Values.tls.enabled }}
containerPort: {{ .Values.containerPorts.http }}
{{- if .Values.extraContainerPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraContainerPorts "context" $) | nindent 12 }}
{{- end }}
{{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
{{- else if .Values.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /info
port: {{ ternary "https" "http" .Values.tls.enabled }}
scheme: {{ ternary "HTTPS" "HTTP" .Values.tls.enabled }}
{{- end }}
{{- if .Values.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }}
{{- else if .Values.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /health
port: {{ ternary "https" "http" .Values.tls.enabled }}
scheme: {{ ternary "HTTPS" "HTTP" .Values.tls.enabled }}
{{- end }}
{{- if .Values.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }}
{{- else if .Values.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /health
port: {{ ternary "https" "http" .Values.tls.enabled }}
scheme: {{ ternary "HTTPS" "HTTP" .Values.tls.enabled }}
{{- end }}
{{- end }}
{{- if .Values.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
volumeMounts:
- name: empty-dir
mountPath: /tmp
subPath: tmp-dir
{{- if .Values.tls.enabled }}
- name: empty-dir
mountPath: /bitnami/zipkin/certs
subPath: app-processed-certs-dir
{{- end }}
{{- if .Values.usePasswordFiles }}
{{- if or .Values.tls.passwordSecret .Values.tls.password .Values.tls.autoGenerated.enabled .Values.tls.usePemCerts }}
- name: keystore-password
mountPath: /bitnami/zipkin/secrets/keystore-password
{{- end }}
{{- if (eq .Values.storageType "cassandra3") }}
- name: database-password
mountPath: /bitnami/zipkin/secrets/database
{{- end }}
{{- if (or .Values.secretConfigOverrides .Values.existingSecret) }}
- name: secret-configuration
mountPath: /bitnami/zipkin/secrets/configuration
{{- end }}
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
- name: empty-dir
emptyDir: {}
{{- if .Values.tls.enabled }}
- name: input-tls-certs
secret:
secretName: {{ include "zipkin.tls.secretName" . }}
items:
{{- if .Values.tls.usePemCerts }}
- key: {{ .Values.tls.certFilename }}
path: tls.crt
- key: {{ .Values.tls.certKeyFilename }}
path: tls.key
{{- else }}
- key: {{ .Values.tls.keystoreFilename }}
path: zipkin.jks
{{- end }}
{{- end }}
{{- if .Values.usePasswordFiles }}
{{- if (eq .Values.storageType "cassandra3") }}
- name: database-password
secret:
secretName: {{ include "zipkin.cassandra.secretName" . }}
items:
- key: {{ include "zipkin.cassandra.passwordKey" . }}
path: CASSANDRA_PASSWORD
{{- end }}
{{- if (or .Values.secretConfigOverrides .Values.existingSecret) }}
- name: secret-configuration
secret:
secretName: {{ include "zipkin.secretName" . }}
{{- end }}
{{- if or .Values.tls.passwordSecret .Values.tls.password .Values.tls.autoGenerated.enabled .Values.tls.usePemCerts }}
- name: keystore-password
secret:
secretName: {{ include "zipkin.tls.passwordSecretName" . }}
items:
- key: keystore-password
path: ARMERIA_SSL_KEY_STORE_PASSWORD
{{- end }}
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}