initial commit
This commit is contained in:
127
mailman3/templates/web.yaml
Normal file
127
mailman3/templates/web.yaml
Normal file
@@ -0,0 +1,127 @@
|
||||
{{- $clusterDomain := default "cluster.local" .Values.clusterDomain}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "mailman3.fullname" . }}-web
|
||||
labels:
|
||||
{{- include "mailman3.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: web
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "mailman3.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: web
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.web.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "mailman3.selectorLabels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: web
|
||||
spec:
|
||||
{{- with .Values.web.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.web.podSecurityContext | nindent 8 }}
|
||||
volumes:
|
||||
- name: web-data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "web.claimName" . }}
|
||||
containers:
|
||||
- name: mailman-web
|
||||
securityContext:
|
||||
{{- toYaml .Values.web.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.web.image.pullPolicy }}
|
||||
env:
|
||||
- name: HYPERKITTY_API_KEY
|
||||
value: {{ .Values.hyperkittyApiKey }}
|
||||
- name: SECRET_KEY
|
||||
value: {{ .Values.djangoSecretKey }}
|
||||
- name: MAILMAN_REST_URL
|
||||
value: http://{{ include "mailman3.fullname" . }}-core.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:8001
|
||||
- name: POSTORIUS_TEMPLATE_BASE_URL
|
||||
value: http://{{ include "mailman3.fullname" . }}-web.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:80
|
||||
{{- if .Values.ingress.enabled }}
|
||||
- name: SERVE_FROM_DOMAIN
|
||||
value: {{ .Values.ingress.host | quote }}
|
||||
{{- end }}
|
||||
- name: DATABASE_URL
|
||||
value: sqlite://///opt/mailman-web-data/mailmanweb.db
|
||||
- name: DATABASE_TYPE
|
||||
value: sqlite
|
||||
- name: MAILMAN_ADMIN_USER
|
||||
value: {{ .Values.admin.username }}
|
||||
- name: MAILMAN_ADMIN_EMAIL
|
||||
value: {{ .Values.admin.email }}
|
||||
{{- if .Values.smtp }}
|
||||
- name: SMTP_HOST
|
||||
value: {{ .Values.smtp }}
|
||||
{{- else }}
|
||||
- name: SMTP_HOST
|
||||
value: {{ include "mailman3.fullname" . }}-core.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}
|
||||
{{- end }}
|
||||
args:
|
||||
- uwsgi
|
||||
- --ini
|
||||
- /opt/mailman-web/uwsgi.ini
|
||||
- --static-map
|
||||
- /static=/opt/mailman-web-data/static
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8000
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
# readinessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
volumeMounts:
|
||||
- name: web-data
|
||||
mountPath: /opt/mailman-web-data
|
||||
resources:
|
||||
{{- toYaml .Values.web.resources | nindent 12 }}
|
||||
{{- with .Values.web.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.web.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.web.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
maxSurge: 0
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "mailman3.fullname" . }}-web
|
||||
labels:
|
||||
{{- include "mailman3.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 8000
|
||||
protocol: TCP
|
||||
selector:
|
||||
{{- include "mailman3.selectorLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: web
|
||||
Reference in New Issue
Block a user