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

122 lines
2.8 KiB
YAML
Raw Normal View History

2021-06-20 10:39:39 +00:00
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-https
spec:
selector:
matchLabels:
nginx: {{ .Release.Name }}
replicas: 1
template:
metadata:
labels:
app: {{ .Release.Name }}
nginx: {{ .Release.Name }}
spec:
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: nginx-config
configMap:
name: {{ .Release.Name }}-nginx-config
- 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
2021-06-20 10:39:39 +00:00
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-{{ .Values.serviceName }}
labels:
app: {{ .Release.Name }}-{{ .Values.serviceName }}
spec:
type: ClusterIP
ports:
- port: 80
name: http
- port: 443
targetPort: 9001
name: https
selector:
app: {{ .Release.Name }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-nginx-config
data:
{{ tpl (.Files.Glob "etherpad/*").AsConfig . | indent 2 }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-letsencrypt-certs
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 50Mi
storageClassName: rook-cephfs
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
2021-06-20 11:08:37 +00:00
name: {{ .Release.Name }}-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: {{ .Release.Name }}-getcert
spec:
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
restartPolicy: Never
containers:
- name: certbot
image: ungleich/ungleich-certbot
ports:
- containerPort: 80
env:
- name: DOMAIN
value: "{{ .Release.Name }}-{{ .Values.serviceName }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
- 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: {{ .Release.Name }}-letsencrypt-certs
backoffLimit: 3