2020-06-28 23:55:16 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: {{ include "wiki.fullname" . }}
|
|
|
|
labels:
|
|
|
|
{{- include "wiki.labels" . | nindent 4 }}
|
|
|
|
spec:
|
|
|
|
replicas: {{ .Values.replicaCount }}
|
2022-04-10 00:29:26 +00:00
|
|
|
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
|
2020-06-28 23:55:16 +00:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "wiki.selectorLabels" . | nindent 6 }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
{{- include "wiki.selectorLabels" . | nindent 8 }}
|
|
|
|
spec:
|
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
serviceAccountName: {{ include "wiki.serviceAccountName" . }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
2021-10-24 19:36:45 +00:00
|
|
|
{{- if .Values.sideload.enabled }}
|
|
|
|
initContainers:
|
|
|
|
- name: {{ .Chart.Name }}-sideload
|
|
|
|
image: "{{ .Values.image.repository }}:{{ default "latest" .Values.image.tag }}"
|
|
|
|
imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
|
|
|
|
env:
|
|
|
|
{{- toYaml .Values.sideload.env | nindent 12 }}
|
|
|
|
command: [ "sh", "-c" ]
|
|
|
|
args: [ "mkdir -p /wiki/data/sideload && git clone --depth=1 {{ .Values.sideload.repoURL }} /wiki/data/sideload/" ]
|
|
|
|
{{- end }}
|
2020-06-28 23:55:16 +00:00
|
|
|
containers:
|
|
|
|
- name: {{ .Chart.Name }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
2020-09-20 00:32:36 +00:00
|
|
|
image: "{{ .Values.image.repository }}:{{ default "latest" .Values.image.tag }}"
|
|
|
|
imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
|
2020-06-28 23:55:16 +00:00
|
|
|
env:
|
2023-03-11 22:14:00 +00:00
|
|
|
{{- if .Values.nodeExtraCaCerts }}
|
|
|
|
- name: NODE_EXTRA_CA_CERTS
|
|
|
|
value: {{ .Values.nodeExtraCaCerts }}
|
|
|
|
{{- end }}
|
2020-06-28 23:55:16 +00:00
|
|
|
- name: DB_TYPE
|
|
|
|
value: postgres
|
2022-07-06 23:40:21 +00:00
|
|
|
{{- if (.Values.externalPostgresql).databaseURL }}
|
2022-07-05 22:26:50 +00:00
|
|
|
- name: DATABASE_URL
|
|
|
|
value: {{ .Values.externalPostgresql.databaseURL }}
|
2022-07-06 23:40:21 +00:00
|
|
|
- name: NODE_TLS_REJECT_UNAUTHORIZED
|
|
|
|
value: {{ default "1" .Values.externalPostgresql.NODE_TLS_REJECT_UNAUTHORIZED | quote }}
|
2022-07-05 22:26:50 +00:00
|
|
|
{{- else }}
|
2020-06-28 23:55:16 +00:00
|
|
|
- name: DB_HOST
|
|
|
|
value: {{ template "wiki.postgresql.host" . }}
|
|
|
|
- name: DB_PORT
|
|
|
|
value: "{{ default "5432" .Values.postgresql.postgresqlPort }}"
|
|
|
|
- name: DB_NAME
|
|
|
|
value: {{ default "wiki" .Values.postgresql.postgresqlDatabase }}
|
|
|
|
- name: DB_USER
|
|
|
|
value: {{ default "wiki" .Values.postgresql.postgresqlUser }}
|
2021-03-23 18:47:57 +00:00
|
|
|
- name: DB_SSL
|
2021-09-14 00:18:05 +00:00
|
|
|
value: "{{ default "false" .Values.postgresql.ssl }}"
|
2021-03-23 18:47:57 +00:00
|
|
|
- name: DB_SSL_CA
|
2021-09-14 00:18:05 +00:00
|
|
|
value: "{{ default "" .Values.postgresql.ca }}"
|
2020-06-28 23:55:16 +00:00
|
|
|
- name: DB_PASS
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
{{- if .Values.postgresql.existingSecret }}
|
|
|
|
name: {{ .Values.postgresql.existingSecret }}
|
|
|
|
{{- else }}
|
|
|
|
name: {{ template "wiki.postgresql.secret" . }}
|
|
|
|
{{- end }}
|
|
|
|
key: {{ template "wiki.postgresql.secretKey" . }}
|
2022-07-05 22:26:50 +00:00
|
|
|
{{- end }}
|
2021-10-09 18:06:23 +00:00
|
|
|
- name: HA_ACTIVE
|
2021-09-14 00:18:05 +00:00
|
|
|
value: {{ .Values.replicaCount | int | le 2 | quote }}
|
2022-02-05 03:47:14 +00:00
|
|
|
{{- with .Values.volumeMounts }}
|
|
|
|
volumeMounts:
|
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-06-28 23:55:16 +00:00
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
containerPort: 3000
|
|
|
|
protocol: TCP
|
|
|
|
livenessProbe:
|
2021-06-24 04:14:44 +00:00
|
|
|
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
2020-06-28 23:55:16 +00:00
|
|
|
readinessProbe:
|
2021-06-24 04:14:44 +00:00
|
|
|
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
2022-07-06 23:40:21 +00:00
|
|
|
startupProbe:
|
|
|
|
{{- toYaml .Values.startupProbe | nindent 12 }}
|
2020-06-28 23:55:16 +00:00
|
|
|
resources:
|
|
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
nodeSelector:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.affinity }}
|
|
|
|
affinity:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.tolerations }}
|
|
|
|
tolerations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2022-02-05 03:47:14 +00:00
|
|
|
{{- with .Values.volumes }}
|
|
|
|
volumes:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|