ungleich-k8s/apps/dev/matrix/templates/element-web.yaml

114 lines
3.3 KiB
YAML
Raw Normal View History

---
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"
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "128Mi"
cpu: "200m"
- 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
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "128Mi"
cpu: "200m"
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 }}