Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 1 | {{- if .Values.dgbuilder.enabled -}} |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 2 | {{/* |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 3 | # Copyright © 2017 Amdocs, Bell Canada, AT&T |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 16 | */}} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 17 | |
| 18 | apiVersion: batch/v1 |
| 19 | kind: Job |
| 20 | metadata: |
| 21 | name: {{ include "common.fullname" . }}-dbinit-job |
| 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
| 24 | app: {{ include "common.name" . }} |
| 25 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 26 | release: {{ include "common.release" . }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 27 | heritage: {{ .Release.Service }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 28 | spec: |
| 29 | backoffLimit: 20 |
| 30 | template: |
| 31 | metadata: |
| 32 | labels: |
| 33 | app: {{ include "common.name" . }}-job |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 34 | release: {{ include "common.release" . }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 35 | name: {{ include "common.name" . }} |
| 36 | spec: |
| 37 | initContainers: |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 38 | - command: |
| 39 | - sh |
| 40 | args: |
| 41 | - -c |
| 42 | - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 43 | env: |
| 44 | - name: AAI_CLIENT_NAME |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 45 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 46 | - name: AAI_CLIENT_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 47 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 48 | - name: MODELSERVICE_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 49 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 50 | - name: MODELSERVICE_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 51 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 52 | - name: RESTCONF_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 53 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 54 | - name: RESTCONF_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 55 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 56 | - name: ANSIBLE_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 57 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 58 | - name: ANSIBLE_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 59 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 60 | - name: SCALEOUT_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 61 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 62 | - name: SCALEOUT_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 63 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 64 | - name: NETBOX_APIKEY |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 65 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 66 | - name: SDNC_DB_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 67 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 68 | - name: SDNC_DB_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 69 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 70 | volumeMounts: |
| 71 | - mountPath: /config-input |
| 72 | name: config-input |
| 73 | - mountPath: /config |
| 74 | name: properties |
Sylvain Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 75 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 76 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 77 | name: {{ include "common.name" . }}-update-config |
| 78 | |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 79 | - name: {{ include "common.name" . }}-readiness |
| 80 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 81 | - /app/ready.py |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 82 | args: |
Andreas Geissler | cfd8434 | 2023-08-16 17:18:49 +0200 | [diff] [blame^] | 83 | - --app-name |
| 84 | - {{ include "common.mariadbAppName" . }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 85 | env: |
| 86 | - name: NAMESPACE |
| 87 | valueFrom: |
| 88 | fieldRef: |
| 89 | apiVersion: v1 |
| 90 | fieldPath: metadata.namespace |
Sylvain Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 91 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 92 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 93 | containers: |
| 94 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 95 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 96 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 97 | env: |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 98 | - name: MYSQL_ROOT_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 99 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 100 | - name: ODL_ADMIN_USERNAME |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 101 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 102 | - name: ODL_ADMIN_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 103 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }} |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 104 | - name: SDNC_DB_USER |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 105 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 106 | - name: SDNC_DB_PASSWORD |
Krzysztof Opasiak | ab7a6bb | 2020-03-24 03:30:51 +0100 | [diff] [blame] | 107 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 108 | - name: MYSQL_HOST |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 109 | value: {{ include "common.mariadbService" . }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 110 | - name: SDNC_HOME |
| 111 | value: "{{.Values.config.sdncHome}}" |
| 112 | - name: ETC_DIR |
| 113 | value: "{{.Values.config.etcDir}}" |
| 114 | - name: BIN_DIR |
| 115 | value: "{{.Values.config.binDir}}" |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 116 | - name: SDNC_DB_DATABASE |
| 117 | value: "{{.Values.config.dbSdnctlDatabase}}" |
| 118 | volumeMounts: |
| 119 | - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh |
| 120 | name: bin |
| 121 | subPath: installSdncDb.sh |
| 122 | - mountPath: {{ .Values.config.configDir }}/svclogic.properties |
| 123 | name: properties |
| 124 | subPath: svclogic.properties |
| 125 | - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties |
| 126 | name: properties |
| 127 | subPath: svclogic.properties |
| 128 | - mountPath: {{ .Values.config.configDir }}/dblib.properties |
| 129 | name: properties |
| 130 | subPath: dblib.properties |
| 131 | command: |
| 132 | - /bin/bash |
| 133 | args: |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 134 | - -c |
| 135 | - | |
| 136 | sleep 60; {{.Values.config.binDir }}/installSdncDb.sh |
Satoshi Fujii | 54bfd17 | 2021-07-04 16:39:41 +0000 | [diff] [blame] | 137 | resources: {{ include "common.resources" . | nindent 10 }} |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 138 | {{- if include "common.onServiceMesh" . }} |
| 139 | - name: sdnc-service-mesh-wait-for-job-container |
| 140 | image: {{ include "repositoryGenerator.image.quitQuit" . }} |
| 141 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 142 | command: |
| 143 | - /bin/sh |
| 144 | - "-c" |
| 145 | args: |
| 146 | - | |
| 147 | echo "waiting 20s for istio side cars to be up"; sleep 20s; |
| 148 | /app/ready.py --service-mesh-check sdnc -t 45; |
| 149 | env: |
| 150 | - name: NAMESPACE |
| 151 | valueFrom: |
| 152 | fieldRef: |
| 153 | apiVersion: v1 |
| 154 | fieldPath: metadata.namespace |
| 155 | {{- end }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 156 | {{- if .Values.nodeSelector }} |
Satoshi Fujii | 54bfd17 | 2021-07-04 16:39:41 +0000 | [diff] [blame] | 157 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} |
| 158 | {{- end }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 159 | {{- if .Values.affinity }} |
Satoshi Fujii | 54bfd17 | 2021-07-04 16:39:41 +0000 | [diff] [blame] | 160 | affinity: {{ toYaml .Values.affinity | nindent 8 }} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 161 | {{- end }} |
vladimir turok | d804418 | 2023-07-27 16:28:36 +0200 | [diff] [blame] | 162 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 163 | volumes: |
| 164 | - name: localtime |
| 165 | hostPath: |
| 166 | path: /etc/localtime |
| 167 | - name: docker-entrypoint-initdb-d |
| 168 | emptyDir: {} |
| 169 | - name: bin |
| 170 | configMap: |
| 171 | name: {{ include "common.fullname" . }}-bin |
| 172 | defaultMode: 0755 |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 173 | - name: config-input |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 174 | configMap: |
| 175 | name: {{ include "common.fullname" . }}-properties |
| 176 | defaultMode: 0644 |
Krzysztof Opasiak | cc97c73 | 2020-02-25 23:31:20 +0100 | [diff] [blame] | 177 | - name: properties |
| 178 | emptyDir: |
| 179 | medium: Memory |
Timoney, Dan (dt5972) | a3bc1a5 | 2019-06-26 16:16:52 -0400 | [diff] [blame] | 180 | restartPolicy: Never |
| 181 | imagePullSecrets: |
| 182 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 183 | {{- end -}} |