ungleich-k8s/apps/etherpadlite-ssl/templates/deployment.yaml

136 lines
3.2 KiB
YAML
Raw Normal View History

2021-06-20 10:39:39 +00:00
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-etherpad
2021-06-20 10:39:39 +00:00
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-etherpad
2021-06-20 10:39:39 +00:00
replicas: 1
template:
metadata:
labels:
app: {{ .Release.Name }}-etherpad
use-as-service: {{ .Release.Name }}
2021-06-20 10:39:39 +00:00
spec:
initContainers:
- name: wait-for-cert
image: busybox
command:
- sh
- -c
- until ls /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/fullchain.pem; do sleep 5; done
2021-06-20 13:04:52 +00:00
volumeMounts:
- name: etcletsencrypt
mountPath: "/etc/letsencrypt"
2021-06-20 10:39:39 +00:00
containers:
- name: etherpad
image: etherpad/etherpad:1.8.13
ports:
- containerPort: 9001
volumeMounts:
- name: etherpadconfig
mountPath: "/opt/etherpad-lite/settings.json"
subPath: settings.json
- name: etcletsencrypt
mountPath: "/etc/letsencrypt"
2021-06-20 11:08:37 +00:00
- name: data
mountPath: "/data"
2021-06-20 10:39:39 +00:00
volumes:
- name: etcletsencrypt
persistentVolumeClaim:
claimName: {{ .Release.Name }}-letsencrypt-certs
2021-06-20 11:08:37 +00:00
- name: data
2021-06-20 10:39:39 +00:00
persistentVolumeClaim:
2021-06-20 11:08:37 +00:00
claimName: {{ .Release.Name }}-data
- name: etherpadconfig
configMap:
name: {{ .Release.Name }}-etherpadconfig
2021-06-20 10:39:39 +00:00
---
apiVersion: v1
kind: Service
metadata:
name: {{ tpl .Values.identifier . }}
2021-06-20 10:39:39 +00:00
labels:
app: {{ tpl .Values.identifier . }}
2021-06-20 10:39:39 +00:00
spec:
type: ClusterIP
ports:
- port: 80
name: http
- port: 443
targetPort: 9001
name: https
selector:
use-as-service: {{ .Release.Name }}
2021-06-20 10:39:39 +00:00
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ tpl .Values.identifier . }}-etherpadconfig
2021-06-20 10:39:39 +00:00
data:
{{ tpl (.Files.Glob "etherpad/*").AsConfig . | indent 2 }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ tpl .Values.identifier . }}-letsencrypt-certs
2021-06-20 10:39:39 +00:00
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 50Mi
storageClassName: rook-cephfs
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ tpl .Values.identifier . }}-data
2021-06-20 10:39:39 +00:00
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Mi
storageClassName: rook-cephfs
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ tpl .Values.identifier . }}-getcert
2021-06-20 10:39:39 +00:00
spec:
template:
metadata:
labels:
app: certbot-letsencrypt-getcert
use-as-service: {{ .Release.Name }}
2021-06-20 10:39:39 +00:00
spec:
restartPolicy: Never
containers:
- name: certbot
image: ungleich/ungleich-certbot
2021-07-17 15:24:35 +00:00
imagePullPolicy: Always
2021-06-20 10:39:39 +00:00
ports:
- containerPort: 80
env:
- name: DOMAIN
value: "{{ tpl .Values.fqdn . }}"
2021-06-20 10:39:39 +00:00
- name: EMAIL
value: "{{ .Values.email }}"
2021-06-20 11:08:37 +00:00
{{ if eq .Values.letsencryptStaging "no" }}
- name: STAGING
value: "no"
{{ end }}
2021-06-20 10:39:39 +00:00
volumeMounts:
- name: etcletsencrypt
mountPath: "/etc/letsencrypt"
volumes:
- name: etcletsencrypt
persistentVolumeClaim:
claimName: {{ tpl .Values.identifier . }}-letsencrypt-certs
2021-06-20 10:39:39 +00:00
backoffLimit: 3