Durgpal | 7ad4069 | 2018-08-03 07:28:36 +0000 | [diff] [blame] | 1 | # Modifications Copyright © 2018 Amdocs,Bell Canada |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 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 | |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 15 | apiVersion: apps/v1 |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 16 | kind: Deployment |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 17 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 18 | spec: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 19 | selector: {{- include "common.selectors" . | nindent 4 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 20 | replicas: {{ .Values.replicaCount }} |
| 21 | template: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 22 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 23 | spec: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 24 | {{- if or .Values.global.aafEnabled .Values.PG.enabled }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 25 | initContainers: |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 26 | - command: |
| 27 | - sh |
| 28 | args: |
| 29 | - -c |
| 30 | - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 31 | env: |
| 32 | - name: PG_USER |
| 33 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }} |
| 34 | - name: PG_PASSWORD |
| 35 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }} |
| 36 | volumeMounts: |
| 37 | - mountPath: /config-input |
| 38 | name: {{ include "common.name" . }}-config-input |
| 39 | - mountPath: /config |
| 40 | name: {{ include "common.name" . }}-config |
| 41 | image: "{{ .Values.global.envsubstImage }}" |
| 42 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 43 | name: {{ include "common.name" . }}-update-config |
| 44 | |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 45 | {{- if .Values.global.aafEnabled }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 46 | - name: {{ include "common.name" . }}-aaf-readiness |
| 47 | command: |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 48 | - /root/ready.py |
| 49 | args: |
| 50 | - --container-name |
dglFromAtt | fb58a9d | 2019-04-12 20:12:26 +0000 | [diff] [blame] | 51 | - aaf-locate |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 52 | - --container-name |
| 53 | - aaf-cm |
| 54 | - --container-name |
| 55 | - aaf-service |
dglFromAtt | fb58a9d | 2019-04-12 20:12:26 +0000 | [diff] [blame] | 56 | env: |
| 57 | - name: NAMESPACE |
| 58 | valueFrom: |
| 59 | fieldRef: |
| 60 | apiVersion: v1 |
| 61 | fieldPath: metadata.namespace |
| 62 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 63 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 64 | - name: {{ include "common.name" . }}-aaf-config |
Ubuntu | 3d5d180 | 2019-11-14 23:16:17 +0000 | [diff] [blame] | 65 | image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}" |
| 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 67 | command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"] |
| 68 | volumeMounts: |
| 69 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 70 | name: {{ include "common.name" . }}-aaf-config-vol |
Ubuntu | 3d5d180 | 2019-11-14 23:16:17 +0000 | [diff] [blame] | 71 | env: |
| 72 | - name: APP_FQI |
| 73 | value: "{{ .Values.aafConfig.fqi }}" |
| 74 | - name: aaf_locate_url |
| 75 | value: "https://aaf-locate.{{ .Release.Namespace }}:8095" |
| 76 | - name: aaf_locator_container |
| 77 | value: "{{ .Values.global.aafLocatorContainer }}" |
| 78 | - name: aaf_locator_container_ns |
| 79 | value: "{{ .Release.Namespace }}" |
| 80 | - name: aaf_locator_fqdn |
| 81 | value: "{{ .Values.aafConfig.fqdn }}" |
| 82 | - name: aaf_locator_public_fqdn |
| 83 | value: "{{.Values.aafConfig.publicFqdn}}" |
| 84 | - name: aaf_locator_app_ns |
| 85 | value: "{{ .Values.global.aafAppNs }}" |
| 86 | - name: DEPLOY_FQI |
| 87 | value: "{{ .Values.aafConfig.aafDeployFqi }}" |
| 88 | - name: DEPLOY_PASSWORD |
| 89 | valueFrom: |
| 90 | secretKeyRef: |
| 91 | name: {{ include "common.fullname" . }}-secret |
| 92 | key: aaf-deploy-password |
| 93 | - name: cadi_longitude |
| 94 | value: "{{ .Values.aafConfig.cadiLongitude }}" |
| 95 | - name: cadi_latitude |
| 96 | value: "{{ .Values.aafConfig.cadiLatitude }}" |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 97 | - name: {{ include "common.name" . }}-permission-fixer |
| 98 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 99 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 100 | volumeMounts: |
| 101 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 102 | name: {{ include "common.name" . }}-aaf-config-vol |
| 103 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
| 104 | # See AAF-425 for explanation of why this is needed. |
| 105 | # This artifact is provisioned in AAF for both pks12 and jks format and apparently |
| 106 | # the cadi library is not using the jks password on the jks keystore. |
| 107 | # So, this attempts to "fix" the credential property file until this is fixed properly. |
| 108 | - name: {{ include "common.name" . }}-cred-fixer |
| 109 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 110 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 111 | volumeMounts: |
| 112 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 113 | name: {{ include "common.name" . }}-aaf-config-vol |
| 114 | command: ["/bin/sh"] |
| 115 | args: [ "-c", "sed -i -e '/cadi_keystore_password=/d' -e '/cadi_keystore_password_jks/p' -e 's/cadi_keystore_password_jks/cadi_keystore_password/' -e 's/dmaap-bc.p12/dmaap-bc.jks/' /opt/app/osaaf/local/org.onap.dmaap-bc.cred.props" ] |
| 116 | |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 117 | {{- end }} |
| 118 | {{- if .Values.PG.enabled }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 119 | - name: {{ include "common.name" . }}-postgres-readiness |
| 120 | command: |
dglFromAtt | fb58a9d | 2019-04-12 20:12:26 +0000 | [diff] [blame] | 121 | - /root/ready.py |
| 122 | args: |
| 123 | - --container-name |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 124 | - {{ .Values.postgres.nameOverride }} |
| 125 | env: |
| 126 | - name: NAMESPACE |
| 127 | valueFrom: |
| 128 | fieldRef: |
| 129 | apiVersion: v1 |
| 130 | fieldPath: metadata.namespace |
| 131 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 132 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 133 | {{- end }} |
| 134 | {{- end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 135 | containers: |
| 136 | - name: {{ include "common.name" . }} |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 137 | image: "{{ .Values.repository }}/{{ .Values.image }}" |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 138 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 139 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 140 | {{ if eq .Values.liveness.enabled true -}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 141 | livenessProbe: |
| 142 | httpGet: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 143 | port: {{ .Values.liveness.port }} |
| 144 | path: /webapi/topics |
| 145 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 146 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
dglFromAtt | ec0918d | 2018-10-17 19:34:49 +0000 | [diff] [blame] | 147 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 148 | {{ end -}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 149 | readinessProbe: |
| 150 | httpGet: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 151 | port: {{ .Values.readiness.port }} |
| 152 | path: /webapi/topics |
| 153 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 154 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 155 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 156 | volumeMounts: |
| 157 | - mountPath: /etc/localtime |
| 158 | name: localtime |
| 159 | readOnly: true |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 160 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 161 | name: {{ include "common.name" . }}-aaf-config-vol |
dglFromAtt | ec0918d | 2018-10-17 19:34:49 +0000 | [diff] [blame] | 162 | # NOTE: on the following several configMaps, careful to include / at end |
| 163 | # since there may be more than one file in each mountPath |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 164 | - name: {{ include "common.name" . }}-config |
dglFromAtt | 8234007 | 2018-10-16 21:53:34 +0000 | [diff] [blame] | 165 | mountPath: /opt/app/config/conf/ |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 166 | resources: {{ include "common.resources" . | nindent 12 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 167 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 168 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 169 | {{- end -}} |
| 170 | {{- if .Values.affinity }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 171 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 172 | {{- end }} |
| 173 | volumes: |
| 174 | - name: localtime |
| 175 | hostPath: |
| 176 | path: /etc/localtime |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 177 | - name: {{ include "common.name" . }}-config-input |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 178 | configMap: |
| 179 | name: {{ include "common.fullname" . }}-config |
Dominic Lunanuova | de7a02b | 2020-03-12 16:36:09 +0000 | [diff] [blame] | 180 | - name: {{ include "common.name" . }}-aaf-config-vol |
| 181 | emptyDir: {} |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 182 | - name: {{ include "common.name" . }}-config |
| 183 | emptyDir: |
| 184 | medium: Memory |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 185 | imagePullSecrets: |
| 186 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |