vaibhavjayas | ea9aee0 | 2018-08-31 06:22:26 +0000 | [diff] [blame] | 1 | # Copyright © 2018 AT&T, Amdocs, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 15 | apiVersion: extensions/v1beta1 |
| 16 | kind: Deployment |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }} |
| 19 | namespace: {{ include "common.namespace" . }} |
| 20 | labels: |
| 21 | app: {{ include "common.name" . }} |
| 22 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 23 | release: {{ include "common.release" . }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
| 26 | replicas: {{ .Values.replicaCount }} |
| 27 | template: |
| 28 | metadata: |
| 29 | labels: |
| 30 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 31 | release: {{ include "common.release" . }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 32 | spec: |
| 33 | initContainers: |
| 34 | - command: |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 35 | - sh |
| 36 | args: |
| 37 | - -c |
| 38 | - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 39 | env: |
| 40 | - name: DB_USER |
| 41 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }} |
| 42 | - name: DB_PASSWORD |
| 43 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }} |
| 44 | - name: HTTP_USER |
| 45 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "http-user-creds" "key" "login") | indent 10 }} |
| 46 | - name: HTTP_PASSWORD |
| 47 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "http-user-creds" "key" "password") | indent 10 }} |
| 48 | - name: HTTP_ADMIN_USER |
| 49 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "admin-creds" "key" "login") | indent 10 }} |
| 50 | - name: HTTP_ADMIN_PASSWORD |
| 51 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "admin-creds" "key" "password") | indent 10 }} |
| 52 | - name: HTTP_NODE_USER |
| 53 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "node-creds" "key" "login") | indent 10 }} |
| 54 | - name: HTTP_NODE_PASSWORD |
| 55 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "node-creds" "key" "password") | indent 10 }} |
| 56 | - name: REST_CONF_USER |
| 57 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }} |
| 58 | - name: REST_CONF_PASSWORD |
| 59 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }} |
| 60 | volumeMounts: |
| 61 | - mountPath: /config-input |
| 62 | name: config-input |
| 63 | - mountPath: /config |
| 64 | name: config |
| 65 | image: "{{ .Values.global.envsubstImage }}" |
| 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 67 | name: {{ include "common.name" . }}-update-config |
| 68 | - command: |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 69 | - /root/ready.py |
| 70 | args: |
| 71 | - --container-name |
jmac | 4f76af4 | 2018-03-28 20:36:47 +0000 | [diff] [blame] | 72 | - {{ .Values.config.dbPodName }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 73 | env: |
| 74 | - name: NAMESPACE |
| 75 | valueFrom: |
| 76 | fieldRef: |
| 77 | apiVersion: v1 |
| 78 | fieldPath: metadata.namespace |
| 79 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 80 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 81 | name: {{ include "common.name" . }}-readiness |
| 82 | containers: |
| 83 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 84 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 85 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
jmac | 4f76af4 | 2018-03-28 20:36:47 +0000 | [diff] [blame] | 86 | command: ["/bin/bash"] |
| 87 | args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"] |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 88 | ports: |
| 89 | - containerPort: {{ .Values.service.internalPort }} |
| 90 | readinessProbe: |
| 91 | tcpSocket: |
| 92 | port: {{ .Values.service.internalPort }} |
| 93 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 94 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 95 | env: |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 96 | - name: SDNC_CONFIG_DIR |
| 97 | value: /opt/onap/sdnc/data/properties |
| 98 | volumeMounts: |
| 99 | - mountPath: /etc/localtime |
| 100 | name: localtime |
| 101 | readOnly: true |
| 102 | - name: config |
| 103 | mountPath: /opt/app/application.properties |
| 104 | subPath: application.properties |
| 105 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 106 | mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/conf/svclogic.properties |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 107 | subPath: svclogic.properties |
| 108 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 109 | mountPath: /opt/onap/ccsdk/dgbuilder/svclogic/svclogic.properties |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 110 | subPath: svclogic.properties |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 111 | - name: config |
afenner | 291d787 | 2018-05-23 14:19:55 +0000 | [diff] [blame] | 112 | mountPath: /opt/onap/ccsdk/dgbuilder/releases/sdnc1.0/customSettings.js |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 113 | subPath: customSettings.js |
| 114 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 115 | {{ include "common.resources" . | indent 12 }} |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 116 | {{- if .Values.nodeSelector }} |
| 117 | nodeSelector: |
| 118 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 119 | {{- end -}} |
| 120 | {{- if .Values.affinity }} |
| 121 | affinity: |
| 122 | {{ toYaml .Values.affinity | indent 10 }} |
| 123 | {{- end }} |
| 124 | volumes: |
| 125 | - name: localtime |
| 126 | hostPath: |
| 127 | path: /etc/localtime |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 128 | - name: config-input |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 129 | configMap: |
| 130 | name: {{ include "common.fullname" . }}-config |
Krzysztof Opasiak | acdd90c | 2020-02-17 22:05:51 +0100 | [diff] [blame] | 131 | - name: config |
| 132 | emptyDir: |
| 133 | medium: Memory |
Mike Elliott | 13fed11 | 2018-02-28 08:33:33 -0500 | [diff] [blame] | 134 | imagePullSecrets: |
| 135 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |