Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 1 | {{/* |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, 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. |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 15 | */}} |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 16 | |
Grzegorz-Lis | 1318a77 | 2020-07-23 15:08:43 +0200 | [diff] [blame] | 17 | apiVersion: apps/v1 |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 18 | kind: Deployment |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 20 | spec: |
| 21 | replicas: {{ .Values.replicaCount }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 23 | template: |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 25 | spec: |
| 26 | initContainers: |
| 27 | - command: |
Krzysztof Opasiak | b9d50c9 | 2020-02-20 21:29:45 +0100 | [diff] [blame] | 28 | - sh |
| 29 | args: |
| 30 | - -c |
| 31 | - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 32 | env: |
| 33 | - name: DB_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 34 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
Krzysztof Opasiak | b9d50c9 | 2020-02-20 21:29:45 +0100 | [diff] [blame] | 35 | - name: DB_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 36 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
Krzysztof Opasiak | b9d50c9 | 2020-02-20 21:29:45 +0100 | [diff] [blame] | 37 | - name: REST_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 38 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "rest-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | b9d50c9 | 2020-02-20 21:29:45 +0100 | [diff] [blame] | 39 | - name: REST_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 40 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "rest-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | b9d50c9 | 2020-02-20 21:29:45 +0100 | [diff] [blame] | 41 | volumeMounts: |
| 42 | - mountPath: /config-input |
| 43 | name: config-input |
| 44 | - mountPath: /config |
| 45 | name: config |
Sylvain Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 46 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | b9d50c9 | 2020-02-20 21:29:45 +0100 | [diff] [blame] | 47 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 48 | name: {{ include "common.name" . }}-update-config |
| 49 | |
| 50 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 51 | - /app/ready.py |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 52 | args: |
| 53 | - --container-name |
| 54 | - {{ .Values.config.sdncChartName }} |
| 55 | env: |
| 56 | - name: NAMESPACE |
| 57 | valueFrom: |
| 58 | fieldRef: |
| 59 | apiVersion: v1 |
| 60 | fieldPath: metadata.namespace |
Sylvain Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 61 | image: {{ include "repositoryGenerator.image.readiness" . }} |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 62 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 63 | name: {{ include "common.name" . }}-readiness |
| 64 | containers: |
| 65 | - name: {{ include "common.name" . }} |
Timoney, Dan (dt5972) | 3a2802f | 2019-02-20 13:58:24 -0500 | [diff] [blame] | 66 | command: ["/bin/bash"] |
Dan Timoney | ef2826f | 2021-09-20 11:37:06 -0400 | [diff] [blame] | 67 | args: ["-c", "cd /opt/ansible-server && ./startAnsibleServer.sh"] |
Timoney, Dan (dt5972) | 3a2802f | 2019-02-20 13:58:24 -0500 | [diff] [blame] | 68 | |
Sylvain Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 69 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 70 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 71 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 72 | # disable liveness probe when breakpoints set in debugger |
| 73 | # so K8s doesn't restart unresponsive container |
| 74 | {{ if .Values.liveness.enabled }} |
| 75 | livenessProbe: |
| 76 | tcpSocket: |
| 77 | port: {{ .Values.service.internalPort }} |
| 78 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 79 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 80 | {{ end }} |
| 81 | readinessProbe: |
| 82 | tcpSocket: |
| 83 | port: {{ .Values.service.internalPort }} |
| 84 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 85 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 86 | volumeMounts: |
| 87 | - mountPath: /etc/localtime |
| 88 | name: localtime |
| 89 | readOnly: true |
| 90 | - mountPath: {{ .Values.config.configDir }}/RestServer_config |
| 91 | name: config |
| 92 | subPath: RestServer_config |
Satoshi Fujii | 54bfd17 | 2021-07-04 16:39:41 +0000 | [diff] [blame] | 93 | resources: {{ include "common.resources" . | nindent 12 }} |
| 94 | {{- if .Values.nodeSelector }} |
| 95 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} |
| 96 | {{- end }} |
| 97 | {{- if .Values.affinity }} |
| 98 | affinity: {{ toYaml .Values.affinity | nindent 8 }} |
| 99 | {{- end }} |
farida azmy | 32c5ed8 | 2021-08-04 14:46:09 +0200 | [diff] [blame] | 100 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 101 | volumes: |
| 102 | - name: localtime |
| 103 | hostPath: |
| 104 | path: /etc/localtime |
Krzysztof Opasiak | b9d50c9 | 2020-02-20 21:29:45 +0100 | [diff] [blame] | 105 | - name: config-input |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 106 | configMap: |
| 107 | name: {{ include "common.fullname" . }} |
| 108 | defaultMode: 0644 |
Krzysztof Opasiak | b9d50c9 | 2020-02-20 21:29:45 +0100 | [diff] [blame] | 109 | - name: config |
| 110 | emptyDir: |
| 111 | medium: Memory |
jmac | 7c43467 | 2018-05-11 20:14:17 +0000 | [diff] [blame] | 112 | imagePullSecrets: |
toshrajbhardwaj | 72b5f0f | 2018-09-13 02:45:22 +0000 | [diff] [blame] | 113 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |