Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 1 | {{/* |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 2 | # Copyright (c) 2017 Amdocs, Bell Canada |
| 3 | # Modifications Copyright (c) 2018 AT&T |
| 4 | # Modifications Copyright (c) 2020 Nokia |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 5 | # Modifications Copyright (c) 2021 Orange |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 6 | # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 18 | */}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 19 | |
| 20 | apiVersion: apps/v1 |
| 21 | kind: Deployment |
| 22 | metadata: |
| 23 | name: {{ include "common.fullname" . }} |
| 24 | namespace: {{ include "common.namespace" . }} |
| 25 | labels: |
| 26 | app: {{ include "common.name" . }} |
| 27 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 28 | release: {{ include "common.release" . }} |
| 29 | heritage: {{ .Release.Service }} |
| 30 | spec: |
| 31 | replicas: {{ .Values.replicaCount }} |
| 32 | selector: |
| 33 | matchLabels: |
| 34 | app: {{ include "common.name" . }} |
| 35 | template: |
| 36 | metadata: |
| 37 | labels: |
| 38 | app: {{ include "common.name" . }} |
| 39 | release: {{ include "common.release" . }} |
| 40 | name: {{ include "common.name" . }} |
| 41 | annotations: |
| 42 | checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 43 | {{- if .Values.global.msbEnabled }} |
| 44 | {{ $values := .Values }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 45 | msb.onap.org/service-info: '[ |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 46 | {{- range $api_endpoint := $values.aai_enpoints -}} |
| 47 | {{- range $api_version := $values.api_list }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 48 | { |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 49 | "serviceName": "_{{ $api_endpoint.name }}", |
| 50 | "version": "v{{ $api_version }}", |
| 51 | "url": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}", |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 52 | "protocol": "REST", |
| 53 | "port": "8447", |
| 54 | "enable_ssl": true, |
| 55 | "lb_policy":"ip_hash", |
| 56 | "visualRange": "1", |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 57 | "path": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}" |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 58 | }, |
| 59 | { |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 60 | "serviceName": "{{ $api_endpoint.name }}", |
| 61 | "version": "v{{ $api_version }}", |
| 62 | "url": "/aai/v{{ $api_version }}/{{ $api_endpoint.url }}", |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 63 | "protocol": "REST", |
| 64 | "port": "8447", |
| 65 | "enable_ssl": true, |
| 66 | "lb_policy":"ip_hash", |
| 67 | "visualRange": "1" |
| 68 | }, |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 69 | {{- end }} |
| 70 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 71 | ]' |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 72 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 73 | spec: |
| 74 | hostname: aai-resources |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 75 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
| 76 | - name: {{ include "common.name" . }}-readiness |
| 77 | command: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 78 | - /app/ready.py |
| 79 | args: |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 80 | {{- if .Values.global.jobs.migration.enabled }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 81 | - --job-name |
| 82 | - {{ include "common.release" . }}-aai-graphadmin-migration |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 83 | {{- else }} |
| 84 | {{- if .Values.global.jobs.createSchema.enabled }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 85 | - --job-name |
| 86 | - {{ include "common.release" . }}-aai-graphadmin-create-db-schema |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 87 | {{- else }} |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 88 | - --container-name |
| 89 | {{- if .Values.global.cassandra.localCluster }} |
| 90 | - aai-cassandra |
| 91 | {{- else }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 92 | - cassandra |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 93 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 94 | - --container-name |
| 95 | - aai-schema-service |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 96 | {{- end }} |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 97 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 98 | env: |
| 99 | - name: NAMESPACE |
| 100 | valueFrom: |
| 101 | fieldRef: |
| 102 | apiVersion: v1 |
| 103 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 104 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 105 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 106 | containers: |
| 107 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 108 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 109 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 110 | command: |
| 111 | - sh |
| 112 | args: |
| 113 | - -c |
| 114 | - | |
| 115 | echo "*** retrieve Truststore and Keystore password" |
| 116 | export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 117 | echo "*** actual launch of AAI Resources" |
| 118 | /bin/bash /opt/app/aai-resources/docker-entrypoint.sh |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 119 | env: |
| 120 | - name: LOCAL_USER_ID |
| 121 | value: {{ .Values.global.config.userId | quote }} |
| 122 | - name: LOCAL_GROUP_ID |
| 123 | value: {{ .Values.global.config.groupId | quote }} |
Harish Venkata Kajur | b06c9af | 2021-02-01 08:59:46 -0500 | [diff] [blame] | 124 | - name: POST_JAVA_OPTS |
Harish Venkata Kajur | 95b39b1 | 2021-06-15 11:49:16 -0400 | [diff] [blame] | 125 | value: '-Djavax.net.ssl.trustStore={{ .Values.certInitializer.credsPath }}/truststoreONAPall.jks -Djavax.net.ssl.trustStorePassword={{ .Values.certInitializer.truststorePassword }}' |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 126 | - name: TRUSTORE_ALL_PASSWORD |
Sylvain Desbureaux | 6b83dab | 2021-02-23 16:03:21 +0100 | [diff] [blame] | 127 | value: {{ .Values.certInitializer.truststorePassword }} |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 128 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 129 | - mountPath: /etc/localtime |
| 130 | name: localtime |
| 131 | readOnly: true |
| 132 | - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-realtime.properties |
| 133 | name: {{ include "common.fullname" . }}-config |
| 134 | subPath: janusgraph-realtime.properties |
| 135 | - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-cached.properties |
| 136 | name: {{ include "common.fullname" . }}-config |
| 137 | subPath: janusgraph-cached.properties |
| 138 | - mountPath: /opt/app/aai-resources/resources/etc/appprops/aaiconfig.properties |
| 139 | name: {{ include "common.fullname" . }}-config |
| 140 | subPath: aaiconfig.properties |
| 141 | - mountPath: /opt/aai/logroot/AAI-RES |
| 142 | name: {{ include "common.fullname" . }}-logs |
| 143 | - mountPath: /opt/app/aai-resources/resources/logback.xml |
| 144 | name: {{ include "common.fullname" . }}-config |
| 145 | subPath: logback.xml |
| 146 | - mountPath: /opt/app/aai-resources/resources/localhost-access-logback.xml |
| 147 | name: {{ include "common.fullname" . }}-config |
| 148 | subPath: localhost-access-logback.xml |
| 149 | - mountPath: /opt/app/aai-resources/resources/etc/auth/realm.properties |
| 150 | name: {{ include "common.fullname" . }}-config |
| 151 | subPath: realm.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 152 | - mountPath: /opt/app/aai-resources/resources/aaf/bath_config.csv |
| 153 | name: {{ include "common.fullname" . }}-aaf-certs |
| 154 | subPath: bath_config.csv |
| 155 | - mountPath: /opt/app/aai-resources/resources/aaf/org.onap.aai.props |
| 156 | name: {{ include "common.fullname" . }}-aaf-properties |
| 157 | subPath: org.onap.aai.props |
| 158 | - mountPath: /opt/app/aai-resources/resources/aaf/org.osaaf.location.props |
| 159 | name: {{ include "common.fullname" . }}-aaf-properties |
| 160 | subPath: org.osaaf.location.props |
| 161 | - mountPath: /opt/app/aai-resources/resources/aaf/permissions.properties |
| 162 | name: {{ include "common.fullname" . }}-aaf-properties |
| 163 | subPath: permissions.properties |
| 164 | - mountPath: /opt/app/aai-resources/resources/cadi.properties |
| 165 | name: {{ include "common.fullname" . }}-aaf-properties |
| 166 | subPath: cadi.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 167 | - mountPath: /opt/app/aai-resources/resources/application.properties |
| 168 | name: {{ include "common.fullname" . }}-config |
| 169 | subPath: application.properties |
| 170 | - mountPath: /opt/app/aai-resources/resources/application-keycloak.properties |
| 171 | name: {{ include "common.fullname" . }}-config |
| 172 | subPath: application-keycloak.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 173 | ports: |
| 174 | - containerPort: {{ .Values.service.internalPort }} |
| 175 | - containerPort: {{ .Values.service.internalPort2 }} |
| 176 | # disable liveness probe when breakpoints set in debugger |
| 177 | # so K8s doesn't restart unresponsive container |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 178 | {{- if .Values.liveness.enabled }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 179 | livenessProbe: |
| 180 | tcpSocket: |
| 181 | port: {{ .Values.service.internalPort }} |
| 182 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 183 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 184 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 185 | readinessProbe: |
| 186 | tcpSocket: |
| 187 | port: {{ .Values.service.internalPort }} |
| 188 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 189 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 190 | resources: {{ include "common.resources" . | nindent 12 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 191 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 192 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 193 | {{- end }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 194 | {{- if .Values.affinity }} |
| 195 | affinity: {{ toYaml .Values.affinity | nindent 8 }} |
| 196 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 197 | # side car containers |
| 198 | - name: filebeat-onap |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 199 | image: {{ include "repositoryGenerator.image.logging" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 200 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 201 | volumeMounts: |
| 202 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 203 | subPath: filebeat.yml |
| 204 | name: filebeat-conf |
| 205 | - mountPath: /var/log/onap |
| 206 | name: {{ include "common.fullname" . }}-logs |
| 207 | - mountPath: /usr/share/filebeat/data |
| 208 | name: {{ include "common.fullname" . }}-filebeat |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 209 | resources: {{ include "common.resources" . | nindent 12 }} |
farida azmy | d893733 | 2021-03-09 12:20:42 +0200 | [diff] [blame^] | 210 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 211 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 212 | - name: localtime |
| 213 | hostPath: |
| 214 | path: /etc/localtime |
| 215 | - name: filebeat-conf |
| 216 | configMap: |
| 217 | name: aai-filebeat |
| 218 | - name: {{ include "common.fullname" . }}-logs |
| 219 | emptyDir: {} |
| 220 | - name: {{ include "common.fullname" . }}-filebeat |
| 221 | emptyDir: {} |
| 222 | - name: {{ include "common.fullname" . }}-config |
| 223 | configMap: |
Sylvain Desbureaux | b4e038d | 2020-12-15 12:00:26 +0100 | [diff] [blame] | 224 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 225 | - name: {{ include "common.fullname" . }}-aaf-properties |
| 226 | configMap: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 227 | name: {{ include "common.fullname" . }}-aaf-props |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 228 | - name: {{ include "common.fullname" . }}-aaf-certs |
| 229 | secret: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 230 | secretName: {{ include "common.fullname" . }}-aaf-keys |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 231 | restartPolicy: {{ .Values.restartPolicy }} |
| 232 | imagePullSecrets: |
| 233 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |