blob: 1ebe340a68cd8a0eb8057093dd349dd492077bfb [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: batch/v1
18kind: Job
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 backoffLimit: 5
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}-mgnt
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040034 spec:
35 serviceAccount: {{ include "common.fullname" . }}
36 serviceAccountName: {{ include "common.fullname" . }}
37 restartPolicy: Never
38 initContainers:
39 - name: {{ include "common.name" . }}-init-readiness
Sylvain Desbureaux5ee4dd42020-11-21 22:52:46 +010040 image: {{ include "repositoryGenerator.image.readiness" . }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040041 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020043 - /app/ready.py
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040044 args:
45 - --container-name
46 - awx-postgres
47 env:
48 - name: NAMESPACE
49 valueFrom:
50 fieldRef:
51 apiVersion: v1
52 fieldPath: metadata.namespace
53 containers:
Andreas Geissler70190b32022-07-12 09:19:32 +020054 - name: {{ include "common.name" . }}-mgnt
55 command:
56 - /bin/sh
57 - -cx
58 - |
59 {{- if include "common.onServiceMesh" . }}
60 echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }}
61 /etc/tower/job-entrypoint.sh
Sylvain Desbureaux5ee4dd42020-11-21 22:52:46 +010062 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.task }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040063 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040064 resources:
65 requests:
66 cpu: 1500m
67 memory: 2Gi
68 securityContext:
69 privileged: true
70 volumeMounts:
71 - mountPath: /etc/tower/job-entrypoint.sh
72 name: awx-mgnt
73 readOnly: true
74 subPath: job-entrypoint.py
75 - mountPath: /etc/tower/settings.py
76 name: awx-application-config
77 readOnly: true
78 subPath: settings.py
79 - mountPath: /etc/tower/conf.d/
80 name: awx-application-credentials
81 readOnly: true
82 - mountPath: /etc/tower/SECRET_KEY
83 name: awx-secret-key
84 readOnly: true
85 subPath: SECRET_KEY
Andreas Geissler70190b32022-07-12 09:19:32 +020086 {{ include "common.waitForJobContainer" . | indent 6 | trim }}
Alexis de Talhouëtf83449d2019-05-09 16:49:30 -040087 volumes:
88 - configMap:
89 defaultMode: 0777
90 items:
91 - key: entrypoint
92 path: job-entrypoint.py
93 name: {{ include "common.fullname" . }}-init-mgnt
94 name: awx-mgnt
95 - configMap:
96 defaultMode: 420
97 items:
98 - key: awx_settings
99 path: settings.py
100 name: {{ include "common.fullname" . }}-settings
101 name: awx-application-config
102 - name: awx-application-credentials
103 secret:
104 defaultMode: 420
105 items:
106 - key: credentials_py
107 path: credentials.py
108 - key: environment_sh
109 path: environment.sh
110 secretName: {{ include "common.fullname" . }}-secrets
111 - name: awx-secret-key
112 secret:
113 defaultMode: 420
114 items:
115 - key: secret_key
116 path: SECRET_KEY
117 secretName: {{ include "common.fullname" . }}-secrets
118 - configMap:
119 defaultMode: 420
120 items:
121 - key: rabbitmq.conf
122 path: rabbitmq.conf
123 - key: enabled_plugins
124 path: enabled_plugins
125 - key: rabbitmq_definitions.json
126 path: rabbitmq_definitions.json
127 name: {{ include "common.fullname" . }}-rabbitmq
128 name: rabbitmq-config
129 imagePullSecrets:
Bartek Grzybowski2f098b02020-10-05 09:34:26 +0200130 - name: "{{ include "common.namespace" . }}-docker-registry-key"