Jakub Latusek | 2bd138d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Geora Barsky | 417b3b4 | 2018-08-17 13:31:36 -0400 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
| 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. |
Jakub Latusek | 2bd138d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
Geora Barsky | 417b3b4 | 2018-08-17 13:31:36 -0400 | [diff] [blame] | 16 | |
| 17 | apiVersion: extensions/v1beta1 |
| 18 | kind: Deployment |
| 19 | metadata: |
| 20 | name: {{ include "common.fullname" . }} |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }} |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
Geora Barsky | 417b3b4 | 2018-08-17 13:31:36 -0400 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | replicas: {{ .Values.replicaCount }} |
| 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
| 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 36 | release: {{ include "common.release" . }} |
Geora Barsky | 417b3b4 | 2018-08-17 13:31:36 -0400 | [diff] [blame] | 37 | name: {{ include "common.name" . }} |
| 38 | spec: |
jmac | af645b5 | 2018-10-11 12:21:54 +0000 | [diff] [blame] | 39 | initContainers: |
| 40 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 41 | - /app/ready.py |
jmac | af645b5 | 2018-10-11 12:21:54 +0000 | [diff] [blame] | 42 | args: |
| 43 | - --container-name |
| 44 | - pomba-elasticsearch |
| 45 | env: |
| 46 | - name: NAMESPACE |
| 47 | valueFrom: |
| 48 | fieldRef: |
| 49 | apiVersion: v1 |
| 50 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 51 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
jmac | af645b5 | 2018-10-11 12:21:54 +0000 | [diff] [blame] | 52 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 53 | name: {{ include "common.name" . }}-readiness |
Geora Barsky | 417b3b4 | 2018-08-17 13:31:36 -0400 | [diff] [blame] | 54 | containers: |
| 55 | - name: {{ include "common.name" . }} |
| 56 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 57 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 58 | env: |
| 59 | - name: CONFIG_HOME |
| 60 | value: /opt/app/search-data-service/config/ |
| 61 | - name: KEY_STORE_PASSWORD |
| 62 | value: {{ .Values.config.keyStorePassword }} |
| 63 | - name: KEY_MANAGER_PASSWORD |
| 64 | value: {{ .Values.config.keyManagerPassword }} |
| 65 | volumeMounts: |
| 66 | - mountPath: /etc/localtime |
| 67 | name: localtime |
| 68 | readOnly: true |
| 69 | - mountPath: /opt/app/search-data-service/config/filter-config.json |
| 70 | subPath: filter-config.json |
| 71 | name: {{ include "common.fullname" . }}-service-config |
| 72 | - mountPath: /opt/app/search-data-service/config/elastic-search.properties |
| 73 | subPath: elastic-search.properties |
| 74 | name: {{ include "common.fullname" . }}-service-config |
| 75 | - mountPath: /opt/app/search-data-service/config/analysis-config.json |
| 76 | subPath: analysis-config.json |
| 77 | name: {{ include "common.fullname" . }}-service-config |
| 78 | - mountPath: /opt/app/search-data-service/config/es-payload-translation.json |
| 79 | subPath: es-payload-translation.json |
| 80 | name: {{ include "common.fullname" . }}-service-config |
| 81 | - mountPath: /opt/app/search-data-service/config/dynamic-custom-template.json |
| 82 | subPath: dynamic-custom-template.json |
| 83 | name: {{ include "common.fullname" . }}-service-config |
| 84 | - mountPath: /opt/app/search-data-service/config/auth/tomcat_keystore |
| 85 | subPath: tomcat_keystore |
| 86 | name: {{ include "common.fullname" . }}-service-auth-config |
| 87 | - mountPath: /opt/app/search-data-service/config/auth/search_policy.json |
| 88 | subPath: search_policy.json |
| 89 | name: {{ include "common.fullname" . }}-search-policy-config |
| 90 | - mountPath: /var/log/onap |
| 91 | name: {{ include "common.fullname" . }}-service-logs |
| 92 | - mountPath: /opt/app/search-data-service/bundleconfig/etc/logback.xml |
| 93 | name: {{ include "common.fullname" . }}-service-log-conf |
| 94 | subPath: logback.xml |
| 95 | ports: |
| 96 | - containerPort: {{ .Values.service.internalPort }} |
| 97 | # disable liveness probe when breakpoints set in debugger |
| 98 | # so K8s doesn't restart unresponsive container |
| 99 | {{- if eq .Values.liveness.enabled true }} |
| 100 | livenessProbe: |
| 101 | tcpSocket: |
| 102 | port: {{ .Values.service.internalPort }} |
| 103 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 104 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 105 | {{ end -}} |
| 106 | readinessProbe: |
| 107 | tcpSocket: |
| 108 | port: {{ .Values.service.internalPort }} |
| 109 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 110 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 111 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 112 | {{ include "common.resources" . | indent 10 }} |
Geora Barsky | 417b3b4 | 2018-08-17 13:31:36 -0400 | [diff] [blame] | 113 | {{- if .Values.nodeSelector }} |
| 114 | nodeSelector: |
| 115 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 116 | {{- end -}} |
| 117 | {{- if .Values.affinity }} |
| 118 | affinity: |
| 119 | {{ toYaml .Values.affinity | indent 8 }} |
| 120 | {{- end }} |
| 121 | |
| 122 | # side car containers |
| 123 | - name: filebeat-onap |
| 124 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 125 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 126 | volumeMounts: |
| 127 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 128 | subPath: filebeat.yml |
| 129 | name: filebeat-conf |
| 130 | - mountPath: /var/log/onap |
| 131 | name: {{ include "common.fullname" . }}-service-logs |
| 132 | - mountPath: /usr/share/filebeat/data |
| 133 | name: {{ include "common.fullname" . }}-service-filebeat |
| 134 | |
| 135 | volumes: |
| 136 | - name: localtime |
| 137 | hostPath: |
| 138 | path: /etc/localtime |
| 139 | - name: {{ include "common.fullname" . }}-service-config |
| 140 | configMap: |
| 141 | name: {{ include "common.fullname" . }} |
| 142 | - name: {{ include "common.fullname" . }}-service-auth-config |
| 143 | secret: |
| 144 | secretName: {{ include "common.fullname" . }}-keystone |
| 145 | - name: {{ include "common.fullname" . }}-search-policy-config |
| 146 | secret: |
| 147 | secretName: {{ include "common.fullname" . }}-policy |
| 148 | - name: filebeat-conf |
| 149 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 150 | name: {{ include "common.release" . }}-pomba-filebeat-configmap |
Geora Barsky | 417b3b4 | 2018-08-17 13:31:36 -0400 | [diff] [blame] | 151 | - name: {{ include "common.fullname" . }}-service-logs |
| 152 | emptyDir: {} |
| 153 | - name: {{ include "common.fullname" . }}-service-filebeat |
| 154 | emptyDir: {} |
| 155 | - name: {{ include "common.fullname" . }}-service-log-conf |
| 156 | configMap: |
| 157 | name: {{ include "common.fullname" . }}-service-log |
| 158 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
| 159 | imagePullSecrets: |
| 160 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |