-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
deployment.yaml
178 lines (178 loc) · 6.6 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "weblate.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "weblate.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: {{ .Values.updateStrategy }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "weblate.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
checksum/secret-env: {{ .Values.extraSecretConfig | toYaml | sha256sum }}
labels:
app.kubernetes.io/name: {{ include "weblate.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "weblate.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
{{- if .Values.postgresql.enabled }}
- name: POSTGRES_DATABASE
value: "{{ .Values.postgresql.postgresqlDatabase }}"
- name: POSTGRES_HOST
value: "{{ .Values.postgresql.postgresqlHost | default (include "weblate.postgresql.fullname" .) }}"
- name: POSTGRES_PORT
value: "{{ .Values.postgresql.service.port }}"
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: {{ include "weblate.fullname" . }}
key: postgresql-user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "weblate.fullname" . }}
key: postgresql-password
{{- end }}
{{- if .Values.redis.enabled }}
- name: REDIS_HOST
value: "{{ .Values.redis.redisHost | default (include "weblate.redis.fullname" .) }}"
- name: REDIS_DB
value: "{{ .Values.redis.db }}"
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "weblate.fullname" . }}
key: redis-password
{{- end }}
- name: WEBLATE_ADMIN_EMAIL
value: "{{ .Values.adminEmail }}"
- name: WEBLATE_ADMIN_NAME
valueFrom:
secretKeyRef:
name: {{ include "weblate.fullname" . }}
key: admin-user
- name: WEBLATE_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "weblate.fullname" . }}
key: admin-password
- name: WEBLATE_SITE_TITLE
value: "{{ .Values.siteTitle }}"
- name: WEBLATE_SITE_DOMAIN
value: "{{ .Values.siteDomain }}"
- name: WEBLATE_EMAIL_HOST
value: "{{ .Values.emailHost }}"
- name: WEBLATE_EMAIL_PORT
value: "{{ .Values.emailPort }}"
- name: WEBLATE_EMAIL_USE_TLS
value: "{{ .Values.emailTLS }}"
- name: WEBLATE_EMAIL_USE_SSL
value: "{{ .Values.emailSSL }}"
- name: WEBLATE_EMAIL_USER
valueFrom:
secretKeyRef:
name: {{ include "weblate.fullname" . }}
key: email-user
- name: WEBLATE_EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "weblate.fullname" . }}
key: email-password
- name: WEBLATE_SERVER_EMAIL
value: "{{ .Values.serverEmail }}"
- name: WEBLATE_DEFAULT_FROM_EMAIL
value: "{{ .Values.defaultFromEmail }}"
- name: WEBLATE_ALLOWED_HOSTS
value: "{{ .Values.allowedHosts }}"
- name: WEBLATE_DEBUG
value: "{{ .Values.debug }}"
{{- range $key, $value := .Values.extraConfig }}
- name: {{ $key | quote }}
value: |-
{{- tpl $value $ | nindent 16 }}
{{- end }}
{{- if (or .Values.extraSecretConfig .Values.externalSecretName) }}
envFrom:
{{- if .Values.extraSecretConfig }}
- secretRef:
name: {{ include "weblate.fullname" . }}-env
{{- end }}
{{- if .Values.externalSecretName }}
- secretRef:
name: {{ .Values.externalSecretName }}
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: /healthz/
port: http
failureThreshold: 10
initialDelaySeconds: 90
periodSeconds: 30
readinessProbe:
httpGet:
path: /healthz/
port: http
failureThreshold: 5
initialDelaySeconds: 90
periodSeconds: 30
volumeMounts:
- mountPath: {{ .Values.persistence.filestore_dir }}
name: weblate-data
- mountPath: "{{ .Values.persistence.filestore_dir }}/settings-override.py"
name: weblate-config
subPath: "settings-override.py"
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: weblate-config
configMap:
name: {{ include "weblate.fullname" . }}
items:
- key: "settings-override.py"
path: "settings-override.py"
- name: weblate-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default ( include "weblate.fullname" . ) }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}