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 |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 4 | # Modifications Copyright (c) 2020 Nokia, Orange |
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": "8446", |
| 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": "8446", |
| 65 | "enable_ssl": true, |
| 66 | "lb_policy":"ip_hash", |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 67 | "visualRange": "1" |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 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 | { |
| 72 | "serviceName": "_aai-named-query", |
| 73 | "url": "/aai/search", |
| 74 | "protocol": "REST", |
| 75 | "port": "8446", |
| 76 | "enable_ssl": true, |
| 77 | "lb_policy":"ip_hash", |
| 78 | "visualRange": "1", |
| 79 | "path": "/aai/search" |
| 80 | }, |
| 81 | { |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 82 | "serviceName": "aai-named-query", |
| 83 | "url": "/aai/search", |
| 84 | "protocol": "REST", |
| 85 | "port": "8446", |
| 86 | "enable_ssl": true, |
| 87 | "lb_policy":"ip_hash", |
| 88 | "visualRange": "1" |
| 89 | } |
| 90 | ]' |
Sylvain Desbureaux | 331f004 | 2021-01-18 11:38:49 +0100 | [diff] [blame] | 91 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 92 | spec: |
| 93 | hostname: aai-traversal |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 94 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 95 | - command: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 96 | - /app/ready.py |
| 97 | args: |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 98 | {{- if .Values.global.jobs.migration.enabled }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 99 | - --job-name |
| 100 | - {{ include "common.release" . }}-aai-graphadmin-migration |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 101 | {{- else }} |
| 102 | {{- if .Values.global.jobs.createSchema.enabled }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 103 | - --job-name |
| 104 | - {{ include "common.release" . }}-aai-graphadmin-create-db-schema |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 105 | {{- else }} |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 106 | - --container-name |
| 107 | {{- if .Values.global.cassandra.localCluster }} |
| 108 | - aai-cassandra |
| 109 | {{- else }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 110 | - cassandra |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 111 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 112 | - --container-name |
| 113 | - aai-schema-service |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 114 | {{- end }} |
| 115 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 116 | env: |
| 117 | - name: NAMESPACE |
| 118 | valueFrom: |
| 119 | fieldRef: |
| 120 | apiVersion: v1 |
| 121 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 122 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 123 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 124 | name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 125 | containers: |
| 126 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 127 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 128 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 129 | command: |
| 130 | - sh |
| 131 | args: |
| 132 | - -c |
| 133 | - | |
| 134 | echo "*** retrieve Truststore and Keystore password" |
| 135 | export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 136 | echo "*** actual launch of AAI Resources" |
| 137 | /bin/bash /opt/app/aai-traversal/docker-entrypoint.sh |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 138 | env: |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 139 | - name: TRUSTORE_ALL_PASSWORD |
Sylvain Desbureaux | 6b83dab | 2021-02-23 16:03:21 +0100 | [diff] [blame] | 140 | value: {{ .Values.certInitializer.truststorePassword }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 141 | - name: DISABLE_UPDATE_QUERY |
| 142 | value: {{ .Values.config.disableUpdateQuery | quote }} |
| 143 | - name: LOCAL_USER_ID |
| 144 | value: {{ .Values.global.config.userId | quote }} |
| 145 | - name: LOCAL_GROUP_ID |
| 146 | value: {{ .Values.global.config.groupId | quote }} |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 147 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 148 | - mountPath: /etc/localtime |
| 149 | name: localtime |
| 150 | readOnly: true |
| 151 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-realtime.properties |
| 152 | name: {{ include "common.fullname" . }}-config |
| 153 | subPath: janusgraph-realtime.properties |
| 154 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-cached.properties |
| 155 | name: {{ include "common.fullname" . }}-config |
| 156 | subPath: janusgraph-cached.properties |
| 157 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/aaiconfig.properties |
| 158 | name: {{ include "common.fullname" . }}-config |
| 159 | subPath: aaiconfig.properties |
| 160 | - mountPath: /opt/aai/logroot/AAI-GQ |
| 161 | name: {{ include "common.fullname" . }}-logs |
| 162 | - mountPath: /opt/aai/logroot/AAI-GQ/misc |
| 163 | name: {{ include "common.fullname" . }}-logs-misc |
| 164 | - mountPath: /opt/app/aai-traversal/resources/logback.xml |
| 165 | name: {{ include "common.fullname" . }}-config |
| 166 | subPath: logback.xml |
| 167 | - mountPath: /opt/app/aai-traversal/resources/localhost-access-logback.xml |
| 168 | name: {{ include "common.fullname" . }}-config |
| 169 | subPath: localhost-access-logback.xml |
| 170 | - mountPath: /opt/app/aai-traversal/resources/etc/auth/realm.properties |
| 171 | name: {{ include "common.fullname" . }}-config |
| 172 | subPath: realm.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 173 | - mountPath: /opt/app/aai-traversal/resources/aaf/bath_config.csv |
| 174 | name: {{ include "common.fullname" . }}-aaf-certs |
| 175 | subPath: bath_config.csv |
| 176 | - mountPath: /opt/app/aai-traversal/resources/aaf/org.onap.aai.props |
| 177 | name: {{ include "common.fullname" . }}-aaf-properties |
| 178 | subPath: org.onap.aai.props |
| 179 | - mountPath: /opt/app/aai-traversal/resources/aaf/org.osaaf.location.props |
| 180 | name: {{ include "common.fullname" . }}-aaf-properties |
| 181 | subPath: org.osaaf.location.props |
| 182 | - mountPath: /opt/app/aai-traversal/resources/aaf/permissions.properties |
| 183 | name: {{ include "common.fullname" . }}-aaf-properties |
| 184 | subPath: permissions.properties |
| 185 | - mountPath: /opt/app/aai-traversal/resources/cadi.properties |
| 186 | name: {{ include "common.fullname" . }}-aaf-properties |
| 187 | subPath: cadi.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 188 | - mountPath: /opt/app/aai-traversal/resources/application.properties |
| 189 | name: {{ include "common.fullname" . }}-config |
| 190 | subPath: application.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 191 | ports: |
| 192 | - containerPort: {{ .Values.service.internalPort }} |
| 193 | - containerPort: {{ .Values.service.internalPort2 }} |
| 194 | # disable liveness probe when breakpoints set in debugger |
| 195 | # so K8s doesn't restart unresponsive container |
| 196 | {{ if .Values.liveness.enabled }} |
| 197 | livenessProbe: |
| 198 | tcpSocket: |
| 199 | port: {{ .Values.service.internalPort }} |
| 200 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 201 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 202 | {{ end }} |
| 203 | readinessProbe: |
| 204 | tcpSocket: |
| 205 | port: {{ .Values.service.internalPort }} |
| 206 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 207 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 208 | resources: |
| 209 | {{ include "common.resources" . }} |
| 210 | {{- if .Values.nodeSelector }} |
| 211 | nodeSelector: |
| 212 | {{ toYaml .Values.nodeSelector | indent 8 }} |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 213 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 214 | {{- if .Values.affinity }} |
| 215 | affinity: |
| 216 | {{ toYaml .Values.affinity | indent 8 }} |
| 217 | {{- end }} |
| 218 | |
| 219 | # side car containers |
| 220 | - name: filebeat-onap |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 221 | image: {{ include "repositoryGenerator.image.logging" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 222 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 223 | volumeMounts: |
| 224 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 225 | subPath: filebeat.yml |
| 226 | name: filebeat-conf |
| 227 | - mountPath: /var/log/onap |
| 228 | name: {{ include "common.fullname" . }}-logs |
| 229 | - mountPath: /usr/share/filebeat/data |
| 230 | name: {{ include "common.fullname" . }}-filebeat |
| 231 | resources: |
| 232 | {{ include "common.resources" . }} |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 233 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 234 | - name: localtime |
| 235 | hostPath: |
| 236 | path: /etc/localtime |
| 237 | - name: filebeat-conf |
| 238 | configMap: |
| 239 | name: aai-filebeat |
| 240 | - name: {{ include "common.fullname" . }}-logs |
| 241 | emptyDir: {} |
| 242 | - name: {{ include "common.fullname" . }}-logs-misc |
| 243 | emptyDir: {} |
| 244 | - name: {{ include "common.fullname" . }}-filebeat |
| 245 | emptyDir: {} |
| 246 | - name: {{ include "common.fullname" . }}-config |
| 247 | configMap: |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 248 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 249 | - name: {{ include "common.fullname" . }}-aaf-properties |
| 250 | configMap: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 251 | name: {{ include "common.fullname" . }}-aaf-props |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 252 | - name: {{ include "common.fullname" . }}-aaf-certs |
| 253 | secret: |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 254 | secretName: {{ include "common.fullname" . }}-aaf |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 255 | - name: aai-common-aai-auth-mount |
| 256 | secret: |
| 257 | secretName: aai-common-aai-auth |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 258 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
| 259 | imagePullSecrets: |
| 260 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |