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 }} |
| 61 | env: |
| 62 | - name: CONFIG_HOME |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 63 | value: /opt/app/sparky/appconfig/ |
| 64 | - name: KEYSTORE_ALIAS_PASSWORD |
| 65 | value: {{ .Values.config.keystoreAliasPassword }} |
| 66 | - name: KEYSTORE_PASSWORD |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 67 | value: {{ .Values.config.keyStorePassword }} |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 68 | - name: SPARKY_SSL_ENABLED |
Arul.Nambi | 89c0279 | 2018-06-20 11:40:17 -0400 | [diff] [blame] | 69 | value: 'false' |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 70 | - name: SPARKY_PORTAL_ENABLED |
| 71 | value: 'false' |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 72 | volumeMounts: |
| 73 | - mountPath: /etc/localtime |
| 74 | name: localtime |
| 75 | readOnly: true |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 76 | - mountPath: /opt/app/sparky/appconfig/auth/ |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 77 | name: {{ include "common.fullname" . }}-auth-config |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 78 | - mountPath: /opt/app/sparky/appconfig/camel-rests/ |
| 79 | name: {{ include "common.fullname" . }}-camel-rests-config |
| 80 | - mountPath: /opt/app/sparky/appconfig/descriptors/ |
| 81 | name: {{ include "common.fullname" . }}-descriptors-config |
| 82 | - mountPath: /opt/app/sparky/appconfig/filters/ |
| 83 | name: {{ include "common.fullname" . }}-filters-config |
| 84 | - mountPath: /opt/app/sparky/appconfig/ |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 85 | name: {{ include "common.fullname" . }}-config |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 86 | - mountPath: /opt/app/sparky/appconfig/portal |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 87 | name: {{ include "common.fullname" . }}-portal-config |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 88 | - mountPath: /opt/app/sparky/appconfig/portal/BOOT-INF/classes |
| 89 | name: {{ include "common.fullname" . }}-portal-boot-inf-config |
| 90 | - mountPath: /opt/app/sparky/appconfig/schemas |
| 91 | name: {{ include "common.fullname" . }}-schemas-config |
| 92 | - mountPath: /opt/app/sparky/appconfig/spring-beans/ |
| 93 | name: {{ include "common.fullname" . }}-spring-beans-config |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 94 | - mountPath: /var/log/onap |
| 95 | name: {{ include "common.fullname" . }}-logs |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 96 | - mountPath: /opt/app/sparky/appconfig/logging/ |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 97 | name: {{ include "common.fullname" . }}-log-conf |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 98 | ports: |
| 99 | - containerPort: {{ .Values.service.internalPort }} |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 100 | - containerPort: {{ .Values.service.internalPort2 }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 101 | # disable liveness probe when breakpoints set in debugger |
| 102 | # so K8s doesn't restart unresponsive container |
| 103 | {{- if eq .Values.liveness.enabled true }} |
| 104 | livenessProbe: |
| 105 | tcpSocket: |
Arul.Nambi | 89c0279 | 2018-06-20 11:40:17 -0400 | [diff] [blame] | 106 | port: {{ .Values.service.internalPort }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 107 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 108 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 109 | {{ end -}} |
| 110 | readinessProbe: |
| 111 | tcpSocket: |
Arul.Nambi | 89c0279 | 2018-06-20 11:40:17 -0400 | [diff] [blame] | 112 | port: {{ .Values.service.internalPort }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 113 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 114 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 115 | resources: |
| 116 | {{ toYaml .Values.resources | indent 10 }} |
| 117 | {{- if .Values.nodeSelector }} |
| 118 | nodeSelector: |
| 119 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 120 | {{- end -}} |
| 121 | {{- if .Values.affinity }} |
| 122 | affinity: |
| 123 | {{ toYaml .Values.affinity | indent 8 }} |
| 124 | {{- end }} |
| 125 | |
| 126 | # side car containers |
| 127 | - name: filebeat-onap |
| 128 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 129 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 130 | volumeMounts: |
| 131 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 132 | subPath: filebeat.yml |
| 133 | name: filebeat-conf |
| 134 | - mountPath: /var/log/onap |
| 135 | name: {{ include "common.fullname" . }}-logs |
| 136 | - mountPath: /usr/share/filebeat/data |
| 137 | name: aai-sparky-filebeat |
| 138 | |
| 139 | volumes: |
| 140 | - name: localtime |
| 141 | hostPath: |
| 142 | path: /etc/localtime |
| 143 | - name: {{ include "common.fullname" . }}-config |
| 144 | configMap: |
| 145 | name: {{ include "common.fullname" . }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 146 | - name: {{ include "common.fullname" . }}-auth-config |
| 147 | secret: |
| 148 | secretName: {{ include "common.fullname" . }} |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 149 | - name: {{ include "common.fullname" . }}-camel-rests-config |
| 150 | configMap: |
| 151 | name: {{ include "common.fullname" . }}-camel-rests |
| 152 | - name: {{ include "common.fullname" . }}-descriptors-config |
| 153 | configMap: |
| 154 | name: {{ include "common.fullname" . }}-descriptors |
| 155 | - name: {{ include "common.fullname" . }}-filters-config |
| 156 | configMap: |
| 157 | name: {{ include "common.fullname" . }}-filters |
| 158 | - name: {{ include "common.fullname" . }}-portal-config |
| 159 | configMap: |
| 160 | name: {{ include "common.fullname" . }}-portal |
| 161 | - name: {{ include "common.fullname" . }}-portal-boot-inf-config |
| 162 | configMap: |
| 163 | name: {{ include "common.fullname" . }}-boot-inf |
| 164 | - name: {{ include "common.fullname" . }}-schemas-config |
| 165 | configMap: |
| 166 | name: {{ include "common.fullname" . }}-schemas |
| 167 | - name: {{ include "common.fullname" . }}-spring-beans-config |
| 168 | configMap: |
| 169 | name: {{ include "common.fullname" . }}-spring-beans |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 170 | - name: filebeat-conf |
| 171 | configMap: |
| 172 | name: aai-filebeat |
| 173 | - name: {{ include "common.fullname" . }}-logs |
| 174 | emptyDir: {} |
| 175 | - name: aai-sparky-filebeat |
| 176 | emptyDir: {} |
| 177 | - name: {{ include "common.fullname" . }}-log-conf |
| 178 | configMap: |
Keren Joseph | 5689d5f | 2018-04-22 15:22:46 +0300 | [diff] [blame] | 179 | name: {{ include "common.fullname" . }}-log |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 180 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
| 181 | imagePullSecrets: |
| 182 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |