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: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 26 | {{- if .Values.global.aafEnabled }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 27 | - name: {{ include "common.name" . }}-aaf-readiness |
| 28 | command: |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 29 | - /root/ready.py |
| 30 | args: |
| 31 | - --container-name |
dglFromAtt | fb58a9d | 2019-04-12 20:12:26 +0000 | [diff] [blame] | 32 | - aaf-locate |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 33 | - --container-name |
| 34 | - aaf-cm |
| 35 | - --container-name |
| 36 | - aaf-service |
dglFromAtt | fb58a9d | 2019-04-12 20:12:26 +0000 | [diff] [blame] | 37 | env: |
| 38 | - name: NAMESPACE |
| 39 | valueFrom: |
| 40 | fieldRef: |
| 41 | apiVersion: v1 |
| 42 | fieldPath: metadata.namespace |
| 43 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 44 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 45 | - name: {{ include "common.name" . }}-aaf-config |
Ubuntu | 3d5d180 | 2019-11-14 23:16:17 +0000 | [diff] [blame] | 46 | image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}" |
| 47 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 48 | command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"] |
| 49 | volumeMounts: |
| 50 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 51 | name: {{ include "common.name" . }}-aaf-config |
| 52 | env: |
| 53 | - name: APP_FQI |
| 54 | value: "{{ .Values.aafConfig.fqi }}" |
| 55 | - name: aaf_locate_url |
| 56 | value: "https://aaf-locate.{{ .Release.Namespace }}:8095" |
| 57 | - name: aaf_locator_container |
| 58 | value: "{{ .Values.global.aafLocatorContainer }}" |
| 59 | - name: aaf_locator_container_ns |
| 60 | value: "{{ .Release.Namespace }}" |
| 61 | - name: aaf_locator_fqdn |
| 62 | value: "{{ .Values.aafConfig.fqdn }}" |
| 63 | - name: aaf_locator_public_fqdn |
| 64 | value: "{{.Values.aafConfig.publicFqdn}}" |
| 65 | - name: aaf_locator_app_ns |
| 66 | value: "{{ .Values.global.aafAppNs }}" |
| 67 | - name: DEPLOY_FQI |
| 68 | value: "{{ .Values.aafConfig.aafDeployFqi }}" |
| 69 | - name: DEPLOY_PASSWORD |
| 70 | valueFrom: |
| 71 | secretKeyRef: |
| 72 | name: {{ include "common.fullname" . }}-secret |
| 73 | key: aaf-deploy-password |
| 74 | - name: cadi_longitude |
| 75 | value: "{{ .Values.aafConfig.cadiLongitude }}" |
| 76 | - name: cadi_latitude |
| 77 | value: "{{ .Values.aafConfig.cadiLatitude }}" |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 78 | {{- end }} |
| 79 | {{- if .Values.PG.enabled }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 80 | - name: {{ include "common.name" . }}-postgres-readiness |
| 81 | command: |
dglFromAtt | fb58a9d | 2019-04-12 20:12:26 +0000 | [diff] [blame] | 82 | - /root/ready.py |
| 83 | args: |
| 84 | - --container-name |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 85 | - {{ .Values.postgres.nameOverride }} |
| 86 | env: |
| 87 | - name: NAMESPACE |
| 88 | valueFrom: |
| 89 | fieldRef: |
| 90 | apiVersion: v1 |
| 91 | fieldPath: metadata.namespace |
| 92 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 93 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 94 | {{- end }} |
| 95 | {{- end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 96 | containers: |
| 97 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 98 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 99 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 100 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 101 | {{ if eq .Values.liveness.enabled true -}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 102 | livenessProbe: |
| 103 | httpGet: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 104 | port: {{ .Values.liveness.port }} |
| 105 | path: /webapi/topics |
| 106 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 107 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
dglFromAtt | ec0918d | 2018-10-17 19:34:49 +0000 | [diff] [blame] | 108 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 109 | {{ end -}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 110 | readinessProbe: |
| 111 | httpGet: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 112 | port: {{ .Values.readiness.port }} |
| 113 | path: /webapi/topics |
| 114 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 115 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 116 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 117 | volumeMounts: |
| 118 | - mountPath: /etc/localtime |
| 119 | name: localtime |
| 120 | readOnly: true |
dglFromAtt | ec0918d | 2018-10-17 19:34:49 +0000 | [diff] [blame] | 121 | # NOTE: on the following several configMaps, careful to include / at end |
| 122 | # since there may be more than one file in each mountPath |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 123 | - name: {{ include "common.name" . }}-config |
dglFromAtt | 8234007 | 2018-10-16 21:53:34 +0000 | [diff] [blame] | 124 | mountPath: /opt/app/config/conf/ |
pkaras | 837db95 | 2019-04-23 13:45:25 +0200 | [diff] [blame] | 125 | - name: {{ include "common.name" . }}-aaf-config |
| 126 | mountPath: /opt/app/dmaapbc/etc/org.onap.dmaap-bc.props |
| 127 | subPath: org.onap.dmaap-bc.props |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 128 | resources: {{ include "common.resources" . | nindent 12 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 129 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 130 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 131 | {{- end -}} |
| 132 | {{- if .Values.affinity }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame^] | 133 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 134 | {{- end }} |
| 135 | volumes: |
| 136 | - name: localtime |
| 137 | hostPath: |
| 138 | path: /etc/localtime |
| 139 | - name: {{ include "common.name" . }}-config |
| 140 | configMap: |
| 141 | name: {{ include "common.fullname" . }}-config |
pkaras | 837db95 | 2019-04-23 13:45:25 +0200 | [diff] [blame] | 142 | - name: {{ include "common.name" . }}-aaf-config |
| 143 | configMap: |
| 144 | name: {{ include "common.fullname" . }}-aaf-config |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 145 | imagePullSecrets: |
| 146 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |