blob: 9910aa4634394665f68955d6855ab95f9a075b37 [file] [log] [blame]
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -04001{{/*
2# Copyright © 2019 Bell Canada
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15*/}}
16
17apiVersion: apps/v1
18kind: StatefulSet
19metadata:
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040026 heritage: {{ .Release.Service }}
27spec:
28 podManagementPolicy: OrderedReady
29 replicas: {{ .Values.replicaCount }}
30 serviceName: {{ include "common.fullname" . }}
31 selector:
32 matchLabels:
33 app: {{ include "common.fullname" . }}
34 name: {{ include "common.name" . }}-web-deploy
35 service: django
36 template:
37 metadata:
38 labels:
39 app: {{ include "common.fullname" . }}
40 name: {{ include "common.name" . }}-web-deploy
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010041 release: {{ include "common.release" . }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040042 service: django
43 spec:
44
45 initContainers:
46 - name: {{ include "common.name" . }}-init-readiness
Sylvain Desbureaux5ee4dd42020-11-21 22:52:46 +010047 image: {{ include "repositoryGenerator.image.readiness" . }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040048 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020050 - /app/ready.py
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040051 args:
52 - --container-name
53 - {{ include "common.name" . }}-mgnt
54 env:
55 - name: NAMESPACE
56 valueFrom:
57 fieldRef:
58 apiVersion: v1
59 fieldPath: metadata.namespace
60
61 containers:
62
Sylvain Desbureaux5ee4dd42020-11-21 22:52:46 +010063 - image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.web }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040064 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
65 name: {{ include "common.name" . }}-web
66 ports:
67 - containerPort: {{ .Values.service.web.internalPort }}
68 protocol: TCP
69 resources:
70 requests:
71 cpu: 500m
72 memory: 1Gi
73 volumeMounts:
74 - mountPath: /etc/tower/settings.py
75 name: awx-application-config
76 readOnly: true
77 subPath: settings.py
78 - mountPath: /etc/tower/conf.d/
79 name: awx-application-credentials
80 readOnly: true
81 - mountPath: /etc/tower/SECRET_KEY
82 name: awx-secret-key
83 readOnly: true
84 subPath: SECRET_KEY
Othman Touijer2f3cfb62021-03-05 08:26:51 +010085 - mountPath: /etc/nginx/nginx.conf
86 name: awx-nginx-conf
87 subPath: "nginx.conf"
88
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040089 - command: ["/bin/sh","-c"]
90 args: ["/usr/bin/launch_awx_task.sh"]
91 env:
92 - name: AWX_SKIP_MIGRATIONS
93 value: "1"
94
Sylvain Desbureaux5ee4dd42020-11-21 22:52:46 +010095 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.task }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040096 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
97 name: {{ include "common.name" . }}-celery
98 resources:
99 requests:
100 cpu: 1500m
101 memory: 2Gi
102 securityContext:
103 privileged: true
104 volumeMounts:
105 - mountPath: /etc/tower/settings.py
106 name: awx-application-config
107 readOnly: true
108 subPath: settings.py
109 - mountPath: /etc/tower/conf.d/
110 name: awx-application-credentials
111 readOnly: true
112 - mountPath: /etc/tower/SECRET_KEY
113 name: awx-secret-key
114 readOnly: true
115 subPath: SECRET_KEY
Othman Touijer2f3cfb62021-03-05 08:26:51 +0100116 - mountPath: /etc/nginx/nginx.conf
117 name: awx-nginx-conf
118 subPath: "nginx.conf"
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -0400119 - env:
120 - name: MY_POD_IP
121 valueFrom:
122 fieldRef:
123 apiVersion: v1
124 fieldPath: status.podIP
125 - name: RABBITMQ_USE_LONGNAME
126 value: "true"
127 - name: RABBITMQ_NODENAME
128 value: rabbit@$(MY_POD_IP)
129 - name: RABBITMQ_ERLANG_COOKIE
130 valueFrom:
131 secretKeyRef:
132 key: rabbitmq_erlang_cookie
133 name: {{ include "common.fullname" . }}-secrets
134 - name: K8S_SERVICE_NAME
135 value: {{ include "common.servicename" . }}-rabbitmq
136
Sylvain Desbureaux5ee4dd42020-11-21 22:52:46 +0100137 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.rabbitmq }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -0400138 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
139 name: {{ include "common.name" . }}-rabbit
140 livenessProbe:
141 exec:
142 command:
143 - rabbitmqctl
144 - status
145 failureThreshold: 3
146 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
147 periodSeconds: {{ .Values.liveness.periodSeconds }}
148 successThreshold: 1
149 timeoutSeconds: 10
150 ports:
151 - containerPort: {{ .Values.service.rabbitmq.http.internalPort }}
152 name: {{ .Values.service.rabbitmq.http.portName }}
153 protocol: TCP
154 - containerPort: {{ .Values.service.rabbitmq.amqp.internalPort }}
155 name: {{ .Values.service.rabbitmq.amqp.portName }}
156 protocol: TCP
157 readinessProbe:
158 exec:
159 command:
160 - rabbitmqctl
161 - status
162 failureThreshold: 3
163 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
164 periodSeconds: {{ .Values.liveness.periodSeconds }}
165 successThreshold: 1
166 timeoutSeconds: 10
167 resources:
168 requests:
169 cpu: 500m
170 memory: 2Gi
171 volumeMounts:
172 - mountPath: /etc/rabbitmq
173 name: rabbitmq-config
174
Sylvain Desbureaux5ee4dd42020-11-21 22:52:46 +0100175 - image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.memcached }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -0400176 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
177 name: {{ include "common.name" . }}-memcached
178 resources:
179 requests:
180 cpu: 500m
181 memory: 1Gi
182 serviceAccount: {{ include "common.fullname" . }}
farida azmye273f782021-10-02 16:04:52 +0200183 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -0400184 volumes:
185 - configMap:
186 defaultMode: 420
187 items:
188 - key: awx_settings
189 path: settings.py
190 name: {{ include "common.fullname" . }}-settings
191 name: awx-application-config
192 - name: awx-application-credentials
193 secret:
194 defaultMode: 420
195 items:
196 - key: credentials_py
197 path: credentials.py
198 - key: environment_sh
199 path: environment.sh
200 secretName: {{ include "common.fullname" . }}-secrets
201 - name: awx-secret-key
202 secret:
203 defaultMode: 420
204 items:
205 - key: secret_key
206 path: SECRET_KEY
207 secretName: {{ include "common.fullname" . }}-secrets
208 - configMap:
209 defaultMode: 420
210 items:
211 - key: rabbitmq.conf
212 path: rabbitmq.conf
213 - key: enabled_plugins
214 path: enabled_plugins
215 - key: rabbitmq_definitions.json
216 path: rabbitmq_definitions.json
217 name: {{ include "common.fullname" . }}-rabbitmq
218 name: rabbitmq-config
Othman Touijer2f3cfb62021-03-05 08:26:51 +0100219 - configMap:
220 defaultMode: 420
221 items:
222 - key: nginx.conf
223 path: nginx.conf
224 name: {{ include "common.fullname" . }}-nginx-conf
225 name: awx-nginx-conf
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -0400226 imagePullSecrets:
Bartek Grzybowski2f098b02020-10-05 09:34:26 +0200227 - name: "{{ include "common.namespace" . }}-docker-registry-key"