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 |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 66 | - mountPath: /opt/app/sparky/config/auth/ |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 67 | name: {{ include "common.fullname" . }}-auth-config |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 68 | |
| 69 | - mountPath: /opt/app/sparky/config/portal/ |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 70 | name: {{ include "common.fullname" . }}-portal-config |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 71 | |
| 72 | - mountPath: /opt/app/sparky/config/portal/BOOT-INF/classes/ |
| 73 | name: {{ include "common.fullname" . }}-portal-config-props |
| 74 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 75 | - mountPath: /var/log/onap |
| 76 | name: {{ include "common.fullname" . }}-logs |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 77 | |
| 78 | - mountPath: /opt/app/sparky/config/application.properties |
| 79 | name: {{ include "common.fullname" . }}-properties |
| 80 | subPath: application.properties |
| 81 | |
| 82 | - mountPath: /opt/app/sparky/config/application-resources.properties |
| 83 | name: {{ include "common.fullname" . }}-properties |
| 84 | subPath: application-resources.properties |
| 85 | |
| 86 | - mountPath: /opt/app/sparky/config/application-ssl.properties |
| 87 | name: {{ include "common.fullname" . }}-properties |
| 88 | subPath: application-ssl.properties |
| 89 | |
| 90 | - mountPath: /opt/app/sparky/config/application-oxm-default.properties |
| 91 | name: {{ include "common.fullname" . }}-properties |
| 92 | subPath: application-oxm-default.properties |
BorislavG | b14a4de | 2018-10-11 11:31:12 +0000 | [diff] [blame] | 93 | |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 94 | - mountPath: /opt/app/sparky/config/application-oxm-override.properties |
| 95 | name: {{ include "common.fullname" . }}-properties |
| 96 | subPath: application-oxm-override.properties |
| 97 | |
| 98 | - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties |
| 99 | name: {{ include "common.fullname" . }}-properties |
| 100 | subPath: application-oxm-schema-prod.properties |
Arul.Nambi | 279c43e | 2018-10-10 16:14:55 -0400 | [diff] [blame] | 101 | |
| 102 | - mountPath: /opt/app/sparky/config/roles.config |
| 103 | name: {{ include "common.fullname" . }}-properties |
| 104 | subPath: roles.config |
| 105 | |
BorislavG | b14a4de | 2018-10-11 11:31:12 +0000 | [diff] [blame] | 106 | - mountPath: /opt/app/sparky/config/users.config |
Arul.Nambi | 279c43e | 2018-10-10 16:14:55 -0400 | [diff] [blame] | 107 | name: {{ include "common.fullname" . }}-properties |
| 108 | subPath: users.config |
BorislavG | b14a4de | 2018-10-11 11:31:12 +0000 | [diff] [blame] | 109 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 110 | ports: |
| 111 | - containerPort: {{ .Values.service.internalPort }} |
| 112 | # disable liveness probe when breakpoints set in debugger |
| 113 | # so K8s doesn't restart unresponsive container |
| 114 | {{- if eq .Values.liveness.enabled true }} |
| 115 | livenessProbe: |
| 116 | tcpSocket: |
Arul.Nambi | 89c0279 | 2018-06-20 11:40:17 -0400 | [diff] [blame] | 117 | port: {{ .Values.service.internalPort }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 118 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 119 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 120 | {{ end -}} |
| 121 | readinessProbe: |
| 122 | tcpSocket: |
Arul.Nambi | 89c0279 | 2018-06-20 11:40:17 -0400 | [diff] [blame] | 123 | port: {{ .Values.service.internalPort }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 124 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 125 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 126 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 127 | {{ include "common.resources" . | indent 12 }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 128 | {{- if .Values.nodeSelector }} |
| 129 | nodeSelector: |
| 130 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 131 | {{- end -}} |
| 132 | {{- if .Values.affinity }} |
| 133 | affinity: |
| 134 | {{ toYaml .Values.affinity | indent 8 }} |
| 135 | {{- end }} |
| 136 | |
| 137 | # side car containers |
| 138 | - name: filebeat-onap |
| 139 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 140 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 141 | volumeMounts: |
| 142 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 143 | subPath: filebeat.yml |
| 144 | name: filebeat-conf |
| 145 | - mountPath: /var/log/onap |
| 146 | name: {{ include "common.fullname" . }}-logs |
| 147 | - mountPath: /usr/share/filebeat/data |
| 148 | name: aai-sparky-filebeat |
| 149 | |
| 150 | volumes: |
| 151 | - name: localtime |
| 152 | hostPath: |
| 153 | path: /etc/localtime |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 154 | |
| 155 | - name: {{ include "common.fullname" . }}-properties |
| 156 | configMap: |
| 157 | name: {{ include "common.fullname" . }}-prop |
| 158 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 159 | - name: {{ include "common.fullname" . }}-config |
| 160 | configMap: |
| 161 | name: {{ include "common.fullname" . }} |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 162 | |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 163 | - name: {{ include "common.fullname" . }}-portal-config |
| 164 | configMap: |
| 165 | name: {{ include "common.fullname" . }}-portal |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 166 | |
| 167 | - name: {{ include "common.fullname" . }}-portal-config-props |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 168 | configMap: |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 169 | name: {{ include "common.fullname" . }}-portal-props |
| 170 | |
| 171 | - name: {{ include "common.fullname" . }}-auth-config |
| 172 | secret: |
| 173 | secretName: {{ include "common.fullname" . }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 174 | - name: filebeat-conf |
| 175 | configMap: |
| 176 | name: aai-filebeat |
| 177 | - name: {{ include "common.fullname" . }}-logs |
| 178 | emptyDir: {} |
| 179 | - name: aai-sparky-filebeat |
| 180 | emptyDir: {} |
rv871f | b59b7fd | 2018-09-05 13:33:10 -0400 | [diff] [blame] | 181 | - name: modeldir |
| 182 | emptyDir: {} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 183 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
| 184 | imagePullSecrets: |
| 185 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |