kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 AT&T |
kj | 9bf2731 | 2018-03-19 15:07:44 +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 "+" "_" }} |
| 24 | release: {{ .Release.Name }} |
| 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
| 27 | replicas: {{ .Values.replicaCount }} |
| 28 | selector: |
| 29 | matchLabels: |
| 30 | app: {{ include "common.name" . }} |
| 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | app: {{ include "common.name" . }} |
| 35 | release: {{ .Release.Name }} |
| 36 | name: {{ include "common.name" . }} |
| 37 | spec: |
Arul.Nambi | b8c668f | 2018-07-17 16:02:30 -0400 | [diff] [blame] | 38 | initContainers: |
| 39 | - command: |
| 40 | - /root/ready.py |
| 41 | args: |
| 42 | - --container-name |
| 43 | - aai-elasticsearch |
| 44 | - --container-name |
| 45 | - aai-search-data |
| 46 | - --container-name |
| 47 | - aai |
| 48 | env: |
| 49 | - name: NAMESPACE |
| 50 | valueFrom: |
| 51 | fieldRef: |
| 52 | apiVersion: v1 |
| 53 | fieldPath: metadata.namespace |
| 54 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 55 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 56 | name: {{ include "common.name" . }}-readiness |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 57 | containers: |
| 58 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 59 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 60 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 61 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 62 | volumeMounts: |
| 63 | - mountPath: /etc/localtime |
| 64 | name: localtime |
| 65 | readOnly: true |
Arul.Nambi | c5f034a | 2019-01-08 01:55:24 -0500 | [diff] [blame^] | 66 | - mountPath: /opt/app/sparky/config/auth/client-cert-onap.p12 |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 67 | name: {{ include "common.fullname" . }}-auth-config |
Arul.Nambi | c5f034a | 2019-01-08 01:55:24 -0500 | [diff] [blame^] | 68 | subPath: client-cert-onap.p12 |
| 69 | |
| 70 | - mountPath: /opt/app/sparky/config/auth/csp-cookie-filter.properties |
| 71 | name: {{ include "common.fullname" . }}-auth-config |
| 72 | subPath: csp-cookie-filter.properties |
| 73 | |
| 74 | - mountPath: /opt/app/sparky/config/auth/org.onap.aai.p12 |
| 75 | name: {{ include "common.fullname" . }}-auth-config |
| 76 | subPath: org.onap.aai.p12 |
| 77 | |
| 78 | - mountPath: /opt/app/sparky/config/auth/truststoreONAPall.jks |
| 79 | name: aai-common-aai-auth-mount |
| 80 | subPath: truststoreONAPall.jks |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 81 | |
| 82 | - mountPath: /opt/app/sparky/config/portal/ |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 83 | name: {{ include "common.fullname" . }}-portal-config |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 84 | |
| 85 | - mountPath: /opt/app/sparky/config/portal/BOOT-INF/classes/ |
| 86 | name: {{ include "common.fullname" . }}-portal-config-props |
| 87 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 88 | - mountPath: /var/log/onap |
| 89 | name: {{ include "common.fullname" . }}-logs |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 90 | |
| 91 | - mountPath: /opt/app/sparky/config/application.properties |
| 92 | name: {{ include "common.fullname" . }}-properties |
| 93 | subPath: application.properties |
| 94 | |
| 95 | - mountPath: /opt/app/sparky/config/application-resources.properties |
| 96 | name: {{ include "common.fullname" . }}-properties |
| 97 | subPath: application-resources.properties |
| 98 | |
| 99 | - mountPath: /opt/app/sparky/config/application-ssl.properties |
| 100 | name: {{ include "common.fullname" . }}-properties |
| 101 | subPath: application-ssl.properties |
| 102 | |
| 103 | - mountPath: /opt/app/sparky/config/application-oxm-default.properties |
| 104 | name: {{ include "common.fullname" . }}-properties |
| 105 | subPath: application-oxm-default.properties |
BorislavG | b14a4de | 2018-10-11 11:31:12 +0000 | [diff] [blame] | 106 | |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 107 | - mountPath: /opt/app/sparky/config/application-oxm-override.properties |
| 108 | name: {{ include "common.fullname" . }}-properties |
| 109 | subPath: application-oxm-override.properties |
| 110 | |
| 111 | - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties |
| 112 | name: {{ include "common.fullname" . }}-properties |
| 113 | subPath: application-oxm-schema-prod.properties |
Arul.Nambi | 279c43e | 2018-10-10 16:14:55 -0400 | [diff] [blame] | 114 | |
| 115 | - mountPath: /opt/app/sparky/config/roles.config |
| 116 | name: {{ include "common.fullname" . }}-properties |
| 117 | subPath: roles.config |
| 118 | |
BorislavG | b14a4de | 2018-10-11 11:31:12 +0000 | [diff] [blame] | 119 | - mountPath: /opt/app/sparky/config/users.config |
Arul.Nambi | 279c43e | 2018-10-10 16:14:55 -0400 | [diff] [blame] | 120 | name: {{ include "common.fullname" . }}-properties |
| 121 | subPath: users.config |
BorislavG | b14a4de | 2018-10-11 11:31:12 +0000 | [diff] [blame] | 122 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 123 | ports: |
| 124 | - containerPort: {{ .Values.service.internalPort }} |
| 125 | # disable liveness probe when breakpoints set in debugger |
| 126 | # so K8s doesn't restart unresponsive container |
| 127 | {{- if eq .Values.liveness.enabled true }} |
| 128 | livenessProbe: |
| 129 | tcpSocket: |
Arul.Nambi | 89c0279 | 2018-06-20 11:40:17 -0400 | [diff] [blame] | 130 | port: {{ .Values.service.internalPort }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 131 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 132 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 133 | {{ end -}} |
| 134 | readinessProbe: |
| 135 | tcpSocket: |
Arul.Nambi | 89c0279 | 2018-06-20 11:40:17 -0400 | [diff] [blame] | 136 | port: {{ .Values.service.internalPort }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 137 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 138 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 139 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 140 | {{ include "common.resources" . | indent 12 }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 141 | {{- if .Values.nodeSelector }} |
| 142 | nodeSelector: |
| 143 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 144 | {{- end -}} |
| 145 | {{- if .Values.affinity }} |
| 146 | affinity: |
| 147 | {{ toYaml .Values.affinity | indent 8 }} |
| 148 | {{- end }} |
| 149 | |
| 150 | # side car containers |
| 151 | - name: filebeat-onap |
| 152 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 153 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 154 | volumeMounts: |
| 155 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 156 | subPath: filebeat.yml |
| 157 | name: filebeat-conf |
| 158 | - mountPath: /var/log/onap |
| 159 | name: {{ include "common.fullname" . }}-logs |
| 160 | - mountPath: /usr/share/filebeat/data |
| 161 | name: aai-sparky-filebeat |
| 162 | |
| 163 | volumes: |
| 164 | - name: localtime |
| 165 | hostPath: |
| 166 | path: /etc/localtime |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 167 | |
| 168 | - name: {{ include "common.fullname" . }}-properties |
| 169 | configMap: |
| 170 | name: {{ include "common.fullname" . }}-prop |
| 171 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 172 | - name: {{ include "common.fullname" . }}-config |
| 173 | configMap: |
| 174 | name: {{ include "common.fullname" . }} |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 175 | |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 176 | - name: {{ include "common.fullname" . }}-portal-config |
| 177 | configMap: |
| 178 | name: {{ include "common.fullname" . }}-portal |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 179 | |
| 180 | - name: {{ include "common.fullname" . }}-portal-config-props |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 181 | configMap: |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 182 | name: {{ include "common.fullname" . }}-portal-props |
| 183 | |
| 184 | - name: {{ include "common.fullname" . }}-auth-config |
| 185 | secret: |
| 186 | secretName: {{ include "common.fullname" . }} |
Arul.Nambi | c5f034a | 2019-01-08 01:55:24 -0500 | [diff] [blame^] | 187 | |
| 188 | - name: aai-common-aai-auth-mount |
| 189 | secret: |
| 190 | secretName: aai-common-aai-auth |
| 191 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 192 | - name: filebeat-conf |
| 193 | configMap: |
| 194 | name: aai-filebeat |
| 195 | - name: {{ include "common.fullname" . }}-logs |
| 196 | emptyDir: {} |
| 197 | - name: aai-sparky-filebeat |
| 198 | emptyDir: {} |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 199 | - name: modeldir |
| 200 | emptyDir: {} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 201 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
| 202 | imagePullSecrets: |
| 203 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |