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