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 | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 75 | initContainers: |
| 76 | - command: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 77 | {{- if .Values.global.jobs.migration.enabled }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 78 | - /app/ready.py |
| 79 | args: |
| 80 | - --job-name |
| 81 | - {{ include "common.release" . }}-aai-graphadmin-migration |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 82 | {{- else }} |
| 83 | {{- if .Values.global.jobs.createSchema.enabled }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 84 | - /app/ready.py |
| 85 | args: |
| 86 | - --job-name |
| 87 | - {{ include "common.release" . }}-aai-graphadmin-create-db-schema |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 88 | {{- else }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 89 | - /app/ready.py |
| 90 | args: |
| 91 | - --container-name |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 92 | {{- if .Values.global.cassandra.localCluster }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 93 | - aai-cassandra |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 94 | {{- else }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 95 | - cassandra |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 96 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 97 | - --container-name |
| 98 | - aai-schema-service |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 99 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 100 | env: |
| 101 | - name: NAMESPACE |
| 102 | valueFrom: |
| 103 | fieldRef: |
| 104 | apiVersion: v1 |
| 105 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 106 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 107 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 108 | name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 109 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 110 | containers: |
| 111 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 112 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 113 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 114 | env: |
| 115 | - name: LOCAL_USER_ID |
| 116 | value: {{ .Values.global.config.userId | quote }} |
| 117 | - name: LOCAL_GROUP_ID |
| 118 | value: {{ .Values.global.config.groupId | quote }} |
Harish Venkata Kajur | b06c9af | 2021-02-01 08:59:46 -0500 | [diff] [blame] | 119 | - name: POST_JAVA_OPTS |
| 120 | value: '-Djavax.net.ssl.trustStore=/opt/app/aai-resources/resources/aaf/truststoreONAPall.jks -Djavax.net.ssl.trustStorePassword=changeit' |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 121 | volumeMounts: |
| 122 | - mountPath: /etc/localtime |
| 123 | name: localtime |
| 124 | readOnly: true |
| 125 | - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-realtime.properties |
| 126 | name: {{ include "common.fullname" . }}-config |
| 127 | subPath: janusgraph-realtime.properties |
| 128 | - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-cached.properties |
| 129 | name: {{ include "common.fullname" . }}-config |
| 130 | subPath: janusgraph-cached.properties |
| 131 | - mountPath: /opt/app/aai-resources/resources/etc/appprops/aaiconfig.properties |
| 132 | name: {{ include "common.fullname" . }}-config |
| 133 | subPath: aaiconfig.properties |
| 134 | - mountPath: /opt/aai/logroot/AAI-RES |
| 135 | name: {{ include "common.fullname" . }}-logs |
| 136 | - mountPath: /opt/app/aai-resources/resources/logback.xml |
| 137 | name: {{ include "common.fullname" . }}-config |
| 138 | subPath: logback.xml |
| 139 | - mountPath: /opt/app/aai-resources/resources/localhost-access-logback.xml |
| 140 | name: {{ include "common.fullname" . }}-config |
| 141 | subPath: localhost-access-logback.xml |
| 142 | - mountPath: /opt/app/aai-resources/resources/etc/auth/realm.properties |
| 143 | name: {{ include "common.fullname" . }}-config |
| 144 | subPath: realm.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 145 | - mountPath: /opt/app/aai-resources/resources/aaf/org.onap.aai.keyfile |
| 146 | name: {{ include "common.fullname" . }}-aaf-certs |
| 147 | subPath: org.onap.aai.keyfile |
| 148 | - mountPath: /opt/app/aai-resources/resources/aaf/bath_config.csv |
| 149 | name: {{ include "common.fullname" . }}-aaf-certs |
| 150 | subPath: bath_config.csv |
| 151 | - mountPath: /opt/app/aai-resources/resources/aaf/org.onap.aai.props |
| 152 | name: {{ include "common.fullname" . }}-aaf-properties |
| 153 | subPath: org.onap.aai.props |
| 154 | - mountPath: /opt/app/aai-resources/resources/aaf/org.osaaf.location.props |
| 155 | name: {{ include "common.fullname" . }}-aaf-properties |
| 156 | subPath: org.osaaf.location.props |
| 157 | - mountPath: /opt/app/aai-resources/resources/aaf/permissions.properties |
| 158 | name: {{ include "common.fullname" . }}-aaf-properties |
| 159 | subPath: permissions.properties |
| 160 | - mountPath: /opt/app/aai-resources/resources/cadi.properties |
| 161 | name: {{ include "common.fullname" . }}-aaf-properties |
| 162 | subPath: cadi.properties |
| 163 | - mountPath: /opt/app/aai-resources/resources/aaf/org.onap.aai.p12 |
| 164 | name: {{ include "common.fullname" . }}-aaf-certs |
| 165 | subPath: org.onap.aai.p12 |
| 166 | - mountPath: /opt/app/aai-resources/resources/aaf/truststoreONAPall.jks |
| 167 | name: aai-common-aai-auth-mount |
| 168 | subPath: truststoreONAPall.jks |
| 169 | - mountPath: /opt/app/aai-resources/resources/application.properties |
| 170 | name: {{ include "common.fullname" . }}-config |
| 171 | subPath: application.properties |
| 172 | - mountPath: /opt/app/aai-resources/resources/application-keycloak.properties |
| 173 | name: {{ include "common.fullname" . }}-config |
| 174 | subPath: application-keycloak.properties |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 175 | {{- $global := . }} |
| 176 | {{- range $job := .Values.global.config.auth.files }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 177 | - mountPath: /opt/app/aai-resources/resources/etc/auth/{{ . }} |
| 178 | name: {{ include "common.fullname" $global }}-auth-truststore-sec |
| 179 | subPath: {{ . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 180 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 181 | ports: |
| 182 | - containerPort: {{ .Values.service.internalPort }} |
| 183 | - containerPort: {{ .Values.service.internalPort2 }} |
| 184 | # disable liveness probe when breakpoints set in debugger |
| 185 | # so K8s doesn't restart unresponsive container |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 186 | {{- if .Values.liveness.enabled }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 187 | livenessProbe: |
| 188 | tcpSocket: |
| 189 | port: {{ .Values.service.internalPort }} |
| 190 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 191 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 192 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 193 | readinessProbe: |
| 194 | tcpSocket: |
| 195 | port: {{ .Values.service.internalPort }} |
| 196 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 197 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 198 | resources: {{ include "common.resources" . | nindent 12 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 199 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 200 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 201 | {{- end }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 202 | {{- if .Values.affinity }} |
| 203 | affinity: {{ toYaml .Values.affinity | nindent 8 }} |
| 204 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 205 | # side car containers |
| 206 | - name: filebeat-onap |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 207 | image: {{ include "repositoryGenerator.image.logging" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 208 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 209 | volumeMounts: |
| 210 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 211 | subPath: filebeat.yml |
| 212 | name: filebeat-conf |
| 213 | - mountPath: /var/log/onap |
| 214 | name: {{ include "common.fullname" . }}-logs |
| 215 | - mountPath: /usr/share/filebeat/data |
| 216 | name: {{ include "common.fullname" . }}-filebeat |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 217 | resources: {{ include "common.resources" . | nindent 12 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 218 | volumes: |
| 219 | - name: aai-common-aai-auth-mount |
| 220 | secret: |
| 221 | secretName: aai-common-aai-auth |
| 222 | - name: localtime |
| 223 | hostPath: |
| 224 | path: /etc/localtime |
| 225 | - name: filebeat-conf |
| 226 | configMap: |
| 227 | name: aai-filebeat |
| 228 | - name: {{ include "common.fullname" . }}-logs |
| 229 | emptyDir: {} |
| 230 | - name: {{ include "common.fullname" . }}-filebeat |
| 231 | emptyDir: {} |
| 232 | - name: {{ include "common.fullname" . }}-config |
| 233 | configMap: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 234 | name: {{ include "common.fullname" . }}-configmap |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 235 | - name: {{ include "common.fullname" . }}-aaf-properties |
| 236 | configMap: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 237 | name: {{ include "common.fullname" . }}-aaf-props |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 238 | - name: {{ include "common.fullname" . }}-aaf-certs |
| 239 | secret: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 240 | secretName: {{ include "common.fullname" . }}-aaf-keys |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 241 | - name: {{ include "common.fullname" . }}-auth-truststore-sec |
| 242 | secret: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 243 | secretName: aai-common-truststore |
| 244 | items: |
| 245 | {{- range $job := .Values.global.config.auth.files }} |
| 246 | - key: {{ . }} |
| 247 | path: {{ . }} |
| 248 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 249 | restartPolicy: {{ .Values.restartPolicy }} |
| 250 | imagePullSecrets: |
| 251 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |