Files
charts/bitnami/appsmith/templates/client/deployment.yaml
Javier J. Salmerón-García 45978ff377 [bitnami/appsmith] fix: 🔒 Move service-account token auto-mount to pod declaration (#22385)
* [bitnami/appsmith] fix: 🔒 Move service-account token auto-mount to pod declaration

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* test:  Update goss test to reflect new value

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* test:  Update goss test to reflect new value

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

---------

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>
Signed-off-by: Javier J. Salmerón-García <jsalmeron@vmware.com>
2024-01-22 11:43:38 +01:00

166 lines
9.3 KiB
YAML

{{- /*
Copyright VMware, Inc.
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.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: client
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.client.replicaCount }}
{{- if .Values.client.updateStrategy }}
strategy: {{- toYaml .Values.client.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.client.podLabels .Values.commonLabels ) "context" . ) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: client
template:
metadata:
{{- if .Values.client.podAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.client.podAnnotations "context" $) | nindent 8 }}
{{- end }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
app.kubernetes.io/component: client
spec:
serviceAccountName: {{ template "appsmith.serviceAccountName" . }}
{{- include "appsmith.imagePullSecrets" . | nindent 6 }}
automountServiceAccountToken: {{ .Values.client.automountServiceAccountToken }}
{{- if .Values.client.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.client.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.client.affinity }}
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.client.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.client.podAffinityPreset "component" "client" "customLabels" $podLabels "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.client.podAntiAffinityPreset "component" "client" "customLabels" $podLabels "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.client.nodeAffinityPreset.type "key" .Values.client.nodeAffinityPreset.key "values" .Values.client.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.client.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.client.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.client.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.client.tolerations "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.client.priorityClassName }}
priorityClassName: {{ .Values.client.priorityClassName | quote }}
{{- end }}
{{- if .Values.client.schedulerName }}
schedulerName: {{ .Values.client.schedulerName | quote }}
{{- end }}
{{- if .Values.client.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.client.topologySpreadConstraints "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.client.podSecurityContext.enabled }}
securityContext: {{- omit .Values.client.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.client.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.client.terminationGracePeriodSeconds }}
{{- end }}
initContainers:
{{- if not .Values.diagnosticMode.enabled }}
{{- include "appsmith.waitForBackendInitContainer" . | nindent 8 }}
{{- include "appsmith.waitForRTSInitContainer" . | nindent 8 }}
{{- end }}
{{- if .Values.client.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.client.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: appsmith
image: {{ template "appsmith.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.client.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.client.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.client.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.client.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.client.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.client.args "context" $) | nindent 12 }}
{{- end }}
env:
- name: BITNAMI_DEBUG
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
- name: APPSMITH_MODE
value: "client"
- name: APPSMITH_API_HOST
value: {{ include "appsmith.backend.fullname" . | quote }}
- name: APPSMITH_API_PORT
value: {{ .Values.backend.service.ports.http | quote }}
- name: APPSMITH_RTS_HOST
value: {{ include "appsmith.rts.fullname" . | quote }}
- name: APPSMITH_RTS_PORT
value: {{ .Values.rts.service.ports.http | quote }}
- name: APPSMITH_UI_HTTP_PORT
value: {{ .Values.client.containerPorts.http | quote }}
{{- if .Values.client.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.client.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
{{- if .Values.client.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.client.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.client.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.client.extraEnvVarsSecret "context" $) }}
{{- end }}
{{- if .Values.client.resources }}
resources: {{- toYaml .Values.client.resources | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.client.containerPorts.http }}
{{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.client.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.client.customLivenessProbe "context" $) | nindent 12 }}
{{- else if .Values.client.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.client.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: http
{{- end }}
{{- if .Values.client.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.client.customReadinessProbe "context" $) | nindent 12 }}
{{- else if .Values.client.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.client.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: http
{{- end }}
{{- if .Values.client.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.client.customStartupProbe "context" $) | nindent 12 }}
{{- else if .Values.client.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.client.startupProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: http
{{- end }}
{{- end }}
{{- if .Values.client.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.client.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.client.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.client.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.client.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.client.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.client.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.client.extraVolumes "context" $) | nindent 8 }}
{{- end }}