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