--- apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Release.Name }}-matrix-element-web spec: selector: matchLabels: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: matrix-element-web replicas: 1 strategy: type: Recreate template: metadata: labels: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: matrix-element-web annotations: checksum/config: {{ include (print $.Template.BasePath "/element-web-proxy.yaml") . | sha256sum }} checksum/config: {{ include (print $.Template.BasePath "/element-web-conf.yaml") . | sha256sum }} spec: containers: - name: nginx image: ungleich/ungleich-certbot:1.1.1 ports: - containerPort: 443 name: https - containerPort: 80 name: http env: - name: DOMAIN value: "{{ tpl .Values.elementWebFQDN . }}" - name: EMAIL value: "{{ .Values.email }}" {{ if eq .Values.letsencryptStaging "no" }} - name: STAGING value: "no" {{ end }} volumeMounts: - name: nginx-config-proxy mountPath: "/nginx-configs" - name: etcletsencrypt mountPath: "/etc/letsencrypt" - name: element-web command: ["nginx", "-g", "daemon off;" ] image: vectorim/element-web:{{ .Values.elementWebVersion }} ports: - containerPort: 8080 volumeMounts: - name: nginx-config mountPath: "/etc/nginx/conf.d/" - name: elementwebconfig mountPath: "/usr/share/nginx/html/config.json" subPath: config.json volumes: - name: nginx-config configMap: name: {{ .Release.Name }}-element-web-nginx - name: nginx-config-proxy configMap: name: {{ .Release.Name }}-element-web-nginx-proxy - name: elementwebconfig configMap: name: {{ .Release.Name }}-element-web - name: etcletsencrypt persistentVolumeClaim: claimName: {{ .Release.Name }}-element-web-letsencrypt-certs --- apiVersion: v1 kind: Service metadata: name: {{ .Release.Name }}-element-web labels: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: matrix-element-web spec: type: ClusterIP ports: - port: 80 name: http - port: 443 name: https selector: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: matrix-element-web --- apiVersion: v1 kind: ConfigMap metadata: name: {{ .Release.Name }}-element-web-nginx labels: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: matrix-element-web data: {{ tpl (.Files.Glob "element-web-nginx/*").AsConfig . | indent 2 }}