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 |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 21 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 22 | spec: |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 23 | selector: {{- include "common.selectors" . | nindent 4 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 24 | replicas: {{ .Values.replicaCount }} |
| 25 | template: |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 26 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 27 | spec: |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 28 | {{- if .Values.global.aafEnabled }} |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 29 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 30 | {{- end }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 31 | containers: |
| 32 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | e79bbc5 | 2020-11-21 22:06:57 +0100 | [diff] [blame] | 33 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 34 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 35 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 36 | # disable liveness probe when breakpoints set in debugger |
| 37 | # so K8s doesn't restart unresponsive container |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 38 | {{- if .Values.global.aafEnabled }} |
| 39 | command: |
aosull01 | f7b781e | 2020-08-28 15:02:06 +0100 | [diff] [blame] | 40 | - sh |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 41 | args: |
| 42 | - -c |
| 43 | - | |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 44 | export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 45 | export JAVA_OPTS="-Djavax.net.ssl.trustStorePassword=$cadi_truststore_password \ |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 46 | -Dserver.ssl.key-store={{ .Values.certInitializer.credsPath }}/org.onap.nbi.p12 \ |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 47 | -Dserver.ssl.key-store-type=PKCS12 \ |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 48 | -Djavax.net.ssl.trustStore={{ .Values.certInitializer.credsPath }}/org.onap.nbi.trust.jks \ |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 49 | -Dserver.ssl.key-store-password=$cadi_keystore_password_p12 \ |
| 50 | -Djavax.net.ssl.trustStoreType=jks\ |
| 51 | -Djava.security.egd=file:/dev/./urandom -Dserver.port=8443" |
aosull01 | 25de836 | 2020-04-09 11:05:30 +0100 | [diff] [blame] | 52 | exec java -XX:+UseContainerSupport $JAVA_OPTS -jar /opt/onap/app.jar |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 53 | {{- end }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 54 | {{ if .Values.liveness.enabled }} |
| 55 | livenessProbe: |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 56 | httpGet: |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 57 | port: {{ if (include "common.needTLS" .) }}{{ .Values.service.internalPort }}{{ else }}{{ .Values.service.internalPlainPort }}{{ end }} |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 58 | path: {{ .Values.liveness.path }} |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 59 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 60 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 61 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 62 | {{ end }} |
| 63 | readinessProbe: |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 64 | httpGet: |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 65 | port: {{ if (include "common.needTLS" .) }}{{ .Values.service.internalPort }}{{ else }}{{ .Values.service.internalPlainPort }}{{ end }} |
Sylvain Desbureaux | d82050c | 2020-03-17 10:43:40 +0100 | [diff] [blame] | 66 | path: {{ .Values.readiness.path }} |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 67 | scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 68 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 69 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 70 | env: |
| 71 | - name: SPRING_DATASOURCE_URL |
Sylvain Desbureaux | 93a5b49 | 2020-11-27 11:07:42 +0100 | [diff] [blame] | 72 | value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "db" "name" }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 73 | - name: SPRING_DATASOURCE_USERNAME |
Krzysztof Opasiak | 783fabf | 2020-03-24 03:26:45 +0100 | [diff] [blame] | 74 | {{- 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] | 75 | - name: SPRING_DATASOURCE_PASSWORD |
Krzysztof Opasiak | 783fabf | 2020-03-24 03:26:45 +0100 | [diff] [blame] | 76 | {{- 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] | 77 | - name: SPRING_DATA_MONGODB_HOST |
| 78 | value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }} |
| 79 | - name: SPRING_DATA_MONGODB_PORT |
| 80 | value: "{{ .Values.mongo.service.internalPort }}" |
| 81 | - name: SPRING_DATA_MONGODB_DATABASE |
| 82 | value: {{ .Values.mongo.config.dbName }} |
| 83 | - name: ONAP_LCPCLOUDREGIONID |
| 84 | value: {{ .Values.config.openStackRegion }} |
| 85 | - name: ONAP_TENANTID |
Sylvain Desbureaux | 33f8367 | 2018-06-01 14:28:39 +0200 | [diff] [blame] | 86 | value: {{ .Values.config.openStackVNFTenantId | quote }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 87 | - name: ONAP_CLOUDOWNER |
| 88 | value: {{ .Values.config.cloudOwner }} |
aleemraja | 40149d8 | 2020-10-16 17:48:17 +0530 | [diff] [blame] | 89 | - name: ONAP_K8SCLOUDREGIONID |
| 90 | value: {{ .Values.config.k8sCloudRegionId }} |
| 91 | - name: ONAP_K8SCLOUDOWNER |
| 92 | value: {{ .Values.config.k8sCloudOwner }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 93 | - name: NBI_URL |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 94 | value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}://nbi.{{ include "common.namespace" . }}:{{ if (include "common.needTLS" .) }}{{ .Values.service.internalPort }}{{ else }}{{ .Values.service.internalPlainPort }}{{ end }}/nbi/api/v4" |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 95 | - name: SDC_HOST |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 96 | value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}://sdc-be.{{ include "common.namespace" . }}:{{ if (include "common.needTLS" .) }}8443{{ else }}8080{{ end }}" |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 97 | - name: SDC_HEADER_ECOMPINSTANCEID |
| 98 | value: {{ .Values.config.ecompInstanceId }} |
| 99 | - name: SDC_HEADER_AUTHORIZATION |
| 100 | value: {{ .Values.sdc_authorization }} |
| 101 | - name: AAI_HOST |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 102 | value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}://aai.{{ include "common.namespace" . }}:{{ if (include "common.needTLS" .) }}8443{{ else }}80{{ end }}" |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 103 | - name: AAI_HEADER_AUTHORIZATION |
| 104 | value: {{ .Values.aai_authorization }} |
| 105 | - name: SO_HOST |
| 106 | value: http://so.{{ include "common.namespace" . }}:8080 |
| 107 | {{- if .Values.so_authorization }} |
| 108 | - name: SO_HEADER_AUTHORIZATION |
| 109 | value: {{ .Values.so_authorization }} |
| 110 | {{- end }} |
aosull01 | 4a11955 | 2019-03-14 15:15:49 +0000 | [diff] [blame] | 111 | - name: DMAAP_HOST |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 112 | value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}://message-router.{{ include "common.namespace" . }}:{{ if (include "common.needTLS" .) }}3905{{ else }}3904{{ end }}" |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 113 | - name: LOGGING_LEVEL_ORG_ONAP_NBI |
| 114 | value: {{ .Values.config.loglevel }} |
Quoc Nghia Nguyen | dd0b365 | 2018-09-17 22:28:28 +0200 | [diff] [blame] | 115 | - name: MSB_ENABLED |
Andreas Geissler | b19c851 | 2022-10-13 13:15:29 +0200 | [diff] [blame] | 116 | value: "{{ .Values.global.msbEnabled }}" |
Quoc Nghia Nguyen | dd0b365 | 2018-09-17 22:28:28 +0200 | [diff] [blame] | 117 | - name: MSB_DISCOVERY_HOST |
| 118 | value: "msb-discovery.{{ include "common.namespace" . }}" |
| 119 | - name: MSB_DISCOVERY_PORT |
| 120 | value: "10081" |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 121 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 12 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 122 | - mountPath: /etc/localtime |
| 123 | name: localtime |
| 124 | readOnly: true |
| 125 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 126 | {{ include "common.resources" . | indent 12 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 127 | {{- if .Values.nodeSelector }} |
| 128 | nodeSelector: |
| 129 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 130 | {{- end -}} |
| 131 | {{- if .Values.affinity }} |
| 132 | affinity: |
| 133 | {{ toYaml .Values.affinity | indent 10 }} |
| 134 | {{- end }} |
farida azmy | 37c9876 | 2021-10-18 13:06:52 +0200 | [diff] [blame] | 135 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Krzysztof Opasiak | 020cdb9 | 2020-05-01 01:46:37 +0200 | [diff] [blame] | 136 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 137 | - name: localtime |
| 138 | hostPath: |
| 139 | path: /etc/localtime |
Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame] | 140 | imagePullSecrets: |
| 141 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |