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