Files
ess-helm/charts/matrix-stack/templates/element-admin/deployment.yaml

100 lines
3.6 KiB
YAML

{{- /*
Copyright 2025 New Vector Ltd
Copyright 2025-2026 Element Creations Ltd
SPDX-License-Identifier: AGPL-3.0-only
*/ -}}
{{- with .Values.elementAdmin -}}
{{- if .enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "element-io.element-admin.labels" (dict "root" $ "context" .) | nindent 4 }}
k8s.element.io/element-admin-config-hash: "{{( include "element-io.element-admin.configmap-data" (dict "root" $ "context" .)) | sha1sum }}"
name: {{ $.Release.Name }}-element-admin
namespace: {{ $.Release.Namespace }}
spec:
{{ include "element-io.ess-library.workloads.commonSpec" (dict "root" $ "context" (dict "nameSuffix" "element-admin" "kind" "Deployment" "componentValues" .)) | nindent 2 }}
template:
metadata:
labels:
{{- include "element-io.element-admin.labels" (dict "root" $ "context" (dict "image" .image "labels" .labels "withChartVersion" false)) | nindent 8 }}
k8s.element.io/element-admin-config-hash: "{{( include "element-io.element-admin.configmap-data" (dict "root" $ "context" .)) | sha1sum }}"
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- include "element-io.ess-library.pods.commonSpec" (dict "root" $ "context" (dict "componentValues" . "instanceSuffix" "element-admin" "kind" "Deployment")) | nindent 6 }}
{{- with .extraInitContainers }}
initContainers:
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: element-admin
{{- include "element-io.ess-library.pods.image" (dict "root" $ "context" .image) | nindent 8 }}
{{- include "element-io.ess-library.pods.env" (dict "root" $ "context" (dict "componentValues" . "componentName" "element-admin")) | nindent 8 }}
{{- with .containersSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
ports:
- containerPort: 8080
name: http
protocol: TCP
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 10 }}
httpGet:
path: /health
port: http
scheme: HTTP
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
httpGet:
path: /health
port: http
scheme: HTTP
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
httpGet:
path: /health
port: http
scheme: HTTP
{{- with .resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- mountPath: /etc/nginx/conf.d/default.conf
name: nginx-config
readOnly: true
subPath: default.conf
- mountPath: /etc/nginx/conf.d/http_customisations.conf
name: nginx-config
readOnly: true
subPath: http_customisations.conf
- mountPath: /etc/nginx/security_headers.conf
name: nginx-config
readOnly: true
subPath: security_headers.conf
- mountPath: /tmp
name: nginx-tmp
{{- range .extraVolumeMounts }}
- {{ (. | toYaml) | nindent 10 }}
{{- end }}
volumes:
- configMap:
defaultMode: 420
name: {{ $.Release.Name }}-element-admin
name: nginx-config
- emptyDir:
medium: Memory
name: nginx-tmp
{{- range .extraVolumes }}
- {{- (tpl (. | toYaml) $) | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}