Jakub Latusek | 922465c | 2020-09-16 12:42:00 +0200 | [diff] [blame] | 1 | {{/* |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 2 | # Copyright © 2018 Orange |
Prateekinlinux | 445a18e | 2018-08-01 06:48:33 +0000 | [diff] [blame] | 3 | # Modifications Copyright © 2018 Amdocs, Bell Canada |
Grzegorz-Lis | b97c60a | 2020-07-29 12:36:06 +0200 | [diff] [blame] | 4 | # Modifications Copyright © 2020 Nokia |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
Jakub Latusek | 922465c | 2020-09-16 12:42:00 +0200 | [diff] [blame] | 17 | */}} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 18 | |
Grzegorz-Lis | b97c60a | 2020-07-29 12:36:06 +0200 | [diff] [blame] | 19 | apiVersion: apps/v1 |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 20 | kind: Deployment |
| 21 | metadata: |
| 22 | name: {{ include "common.fullname" . }} |
| 23 | namespace: {{ include "common.namespace" . }} |
| 24 | labels: |
| 25 | app: {{ include "common.name" . }} |
| 26 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 27 | release: {{ include "common.release" . }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 28 | heritage: {{ .Release.Service }} |
| 29 | spec: |
Grzegorz-Lis | b97c60a | 2020-07-29 12:36:06 +0200 | [diff] [blame] | 30 | selector: |
| 31 | matchLabels: |
| 32 | app: {{ include "common.name" . }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 33 | replicas: {{ .Values.replicaCount }} |
| 34 | template: |
| 35 | metadata: |
| 36 | labels: |
| 37 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 38 | release: {{ include "common.release" . }} |
Sylvain Desbureaux | 1d061a4 | 2019-11-08 15:27:20 +0100 | [diff] [blame] | 39 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 40 | spec: |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 41 | {{- if .Values.global.aafEnabled }} |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 42 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 43 | {{- end }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 44 | containers: |
| 45 | - name: {{ include "common.name" . }} |
| 46 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 47 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 48 | ports: |
| 49 | - containerPort: {{ .Values.service.internalPort }} |
| 50 | # disable liveness probe when breakpoints set in debugger |
| 51 | # so K8s doesn't restart unresponsive container |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 52 | {{- if .Values.global.aafEnabled }} |
| 53 | command: |
| 54 | - bash |
| 55 | args: |
| 56 | - -c |
| 57 | - | |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 58 | export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 59 | export JAVA_OPTS="-Djavax.net.ssl.trustStorePassword=$cadi_truststore_password \ |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 60 | -Dserver.ssl.key-store={{ .Values.certInitializer.credsPath }}/org.onap.nbi.p12 \ |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 61 | -Dserver.ssl.key-store-type=PKCS12 \ |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 62 | -Djavax.net.ssl.trustStore={{ .Values.certInitializer.credsPath }}/org.onap.nbi.trust.jks \ |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 63 | -Dserver.ssl.key-store-password=$cadi_keystore_password_p12 \ |
| 64 | -Djavax.net.ssl.trustStoreType=jks\ |
| 65 | -Djava.security.egd=file:/dev/./urandom -Dserver.port=8443" |
aosull01 | 25de836 | 2020-04-09 11:05:30 +0100 | [diff] [blame] | 66 | exec java -XX:+UseContainerSupport $JAVA_OPTS -jar /opt/onap/app.jar |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 67 | {{- end }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 68 | {{ if .Values.liveness.enabled }} |
| 69 | livenessProbe: |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 70 | httpGet: |
| 71 | port: {{ .Values.liveness.port }} |
| 72 | path: {{ .Values.liveness.path }} |
| 73 | scheme: HTTPS |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 74 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 75 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 76 | {{ end }} |
| 77 | readinessProbe: |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 78 | httpGet: |
| 79 | port: {{ .Values.readiness.port }} |
| 80 | path: {{ .Values.readiness.path }} |
| 81 | scheme: HTTPS |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 82 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 83 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 84 | env: |
| 85 | - name: SPRING_DATASOURCE_URL |
Sylvain Desbureaux | 1d061a4 | 2019-11-08 15:27:20 +0100 | [diff] [blame] | 86 | value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 87 | - name: SPRING_DATASOURCE_USERNAME |
Krzysztof Opasiak | 783fabf | 2020-03-24 03:26:45 +0100 | [diff] [blame] | 88 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "login") | indent 14 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 89 | - name: SPRING_DATASOURCE_PASSWORD |
Krzysztof Opasiak | 783fabf | 2020-03-24 03:26:45 +0100 | [diff] [blame] | 90 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "password") | indent 14 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 91 | - name: SPRING_DATA_MONGODB_HOST |
| 92 | value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }} |
| 93 | - name: SPRING_DATA_MONGODB_PORT |
| 94 | value: "{{ .Values.mongo.service.internalPort }}" |
| 95 | - name: SPRING_DATA_MONGODB_DATABASE |
| 96 | value: {{ .Values.mongo.config.dbName }} |
| 97 | - name: ONAP_LCPCLOUDREGIONID |
| 98 | value: {{ .Values.config.openStackRegion }} |
| 99 | - name: ONAP_TENANTID |
Sylvain Desbureaux | 33f8367 | 2018-06-01 14:28:39 +0200 | [diff] [blame] | 100 | value: {{ .Values.config.openStackVNFTenantId | quote }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 101 | - name: ONAP_CLOUDOWNER |
| 102 | value: {{ .Values.config.cloudOwner }} |
| 103 | - name: NBI_URL |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 104 | value: "https://nbi.{{ include "common.namespace" . }}:8443/nbi/api/v4" |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 105 | - name: SDC_HOST |
Matthieu Geerebaert | 3dc7082 | 2019-11-06 16:57:49 +0100 | [diff] [blame] | 106 | value: "https://sdc-be.{{ include "common.namespace" . }}:8443" |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 107 | - name: SDC_HEADER_ECOMPINSTANCEID |
| 108 | value: {{ .Values.config.ecompInstanceId }} |
| 109 | - name: SDC_HEADER_AUTHORIZATION |
| 110 | value: {{ .Values.sdc_authorization }} |
| 111 | - name: AAI_HOST |
Eric Debeau | b030765 | 2018-05-22 06:43:39 +0000 | [diff] [blame] | 112 | value: "https://aai.{{ include "common.namespace" . }}:8443" |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 113 | - name: AAI_HEADER_AUTHORIZATION |
| 114 | value: {{ .Values.aai_authorization }} |
| 115 | - name: SO_HOST |
| 116 | value: http://so.{{ include "common.namespace" . }}:8080 |
| 117 | {{- if .Values.so_authorization }} |
| 118 | - name: SO_HEADER_AUTHORIZATION |
| 119 | value: {{ .Values.so_authorization }} |
| 120 | {{- end }} |
aosull01 | 4a11955 | 2019-03-14 15:15:49 +0000 | [diff] [blame] | 121 | - name: DMAAP_HOST |
aosull01 | 25de836 | 2020-04-09 11:05:30 +0100 | [diff] [blame] | 122 | value: "https://message-router.{{ include "common.namespace" . }}:3905" |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 123 | - name: LOGGING_LEVEL_ORG_ONAP_NBI |
| 124 | value: {{ .Values.config.loglevel }} |
Quoc Nghia Nguyen | dd0b365 | 2018-09-17 22:28:28 +0200 | [diff] [blame] | 125 | - name: MSB_ENABLED |
| 126 | value: "true" |
| 127 | - name: MSB_DISCOVERY_HOST |
| 128 | value: "msb-discovery.{{ include "common.namespace" . }}" |
| 129 | - name: MSB_DISCOVERY_PORT |
| 130 | value: "10081" |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 131 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 12 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 132 | - mountPath: /etc/localtime |
| 133 | name: localtime |
| 134 | readOnly: true |
| 135 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 136 | {{ include "common.resources" . | indent 12 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 137 | {{- if .Values.nodeSelector }} |
| 138 | nodeSelector: |
| 139 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 140 | {{- end -}} |
| 141 | {{- if .Values.affinity }} |
| 142 | affinity: |
| 143 | {{ toYaml .Values.affinity | indent 10 }} |
| 144 | {{- end }} |
| 145 | # side car containers |
| 146 | # - name: filebeat-onap |
| 147 | # image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 148 | # imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 149 | # volumeMounts: |
| 150 | # - mountPath: /usr/share/filebeat/filebeat.yml |
| 151 | # name: filebeat-conf |
| 152 | # subPath: filebeat.yml |
| 153 | # - mountPath: /home/esr/works/logs |
| 154 | # name: esr-server-logs |
| 155 | # - mountPath: /usr/share/filebeat/data |
| 156 | # name: esr-server-filebeat |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 157 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 158 | - name: localtime |
| 159 | hostPath: |
| 160 | path: /etc/localtime |
| 161 | # - name: filebeat-conf |
| 162 | # configMap: |
| 163 | # name: {{ include "common.fullname" . }}-esr-filebeat |
| 164 | # - name: esr-server-logs |
| 165 | # emptyDir: {} |
| 166 | # - name: esr-server-filebeat |
| 167 | # emptyDir: {} |
| 168 | # - name: esrserver-log |
| 169 | # configMap: |
| 170 | # name: {{ include "common.fullname" . }}-esr-esrserver-log |
| 171 | imagePullSecrets: |
| 172 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |