kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | apiVersion: extensions/v1beta1 |
| 16 | kind: Deployment |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }} |
| 19 | namespace: {{ include "common.namespace" . }} |
| 20 | labels: |
| 21 | app: {{ include "common.name" . }} |
| 22 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 23 | release: {{ .Release.Name }} |
| 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
| 26 | replicas: {{ .Values.replicaCount }} |
| 27 | selector: |
| 28 | matchLabels: |
| 29 | app: {{ include "common.name" . }} |
| 30 | template: |
| 31 | metadata: |
| 32 | labels: |
| 33 | app: {{ include "common.name" . }} |
| 34 | release: {{ .Release.Name }} |
| 35 | name: {{ include "common.name" . }} |
| 36 | spec: |
| 37 | containers: |
| 38 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame^] | 39 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 40 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 41 | env: |
| 42 | - name: CONFIG_HOME |
| 43 | value: /opt/app/search-data-service/config/ |
| 44 | - name: KEY_STORE_PASSWORD |
| 45 | value: {{ .Values.config.keyStorePassword }} |
| 46 | - name: KEY_MANAGER_PASSWORD |
| 47 | value: {{ .Values.config.keyManagerPassword }} |
| 48 | volumeMounts: |
| 49 | - mountPath: /etc/localtime |
| 50 | name: localtime |
| 51 | readOnly: true |
| 52 | - mountPath: /opt/app/search-data-service/config/filter-config.json |
| 53 | subPath: filter-config.json |
| 54 | name: {{ include "common.fullname" . }}-service-config |
| 55 | - mountPath: /opt/app/search-data-service/config/elastic-search.properties |
| 56 | subPath: elastic-search.properties |
| 57 | name: {{ include "common.fullname" . }}-service-config |
| 58 | - mountPath: /opt/app/search-data-service/config/analysis-config.json |
| 59 | subPath: filter-config.json |
| 60 | name: {{ include "common.fullname" . }}-service-config |
| 61 | - mountPath: /opt/app/search-data-service/config/auth/tomcat_keystore |
| 62 | subPath: tomcat_keystore |
| 63 | name: {{ include "common.fullname" . }}-service-auth-config |
| 64 | - mountPath: /opt/app/search-data-service/config/auth/search_policy.json |
| 65 | subPath: search_policy.json |
| 66 | name: {{ include "common.fullname" . }}-search-policy-config |
| 67 | - mountPath: /var/log/onap |
| 68 | name: {{ include "common.fullname" . }}-service-logs |
| 69 | - mountPath: /opt/app/search-data-service/bundleconfig/etc/logback.xml |
| 70 | name: {{ include "common.fullname" . }}-service-log-conf |
| 71 | subPath: logback.xml |
| 72 | ports: |
| 73 | - containerPort: {{ .Values.service.internalPort }} |
| 74 | # disable liveness probe when breakpoints set in debugger |
| 75 | # so K8s doesn't restart unresponsive container |
| 76 | {{- if eq .Values.liveness.enabled true }} |
| 77 | livenessProbe: |
| 78 | tcpSocket: |
| 79 | port: {{ .Values.service.internalPort }} |
| 80 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 81 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 82 | {{ end -}} |
| 83 | readinessProbe: |
| 84 | tcpSocket: |
| 85 | port: {{ .Values.service.internalPort }} |
| 86 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 87 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 88 | resources: |
| 89 | {{ toYaml .Values.resources | indent 10 }} |
| 90 | {{- if .Values.nodeSelector }} |
| 91 | nodeSelector: |
| 92 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 93 | {{- end -}} |
| 94 | {{- if .Values.affinity }} |
| 95 | affinity: |
| 96 | {{ toYaml .Values.affinity | indent 8 }} |
| 97 | {{- end }} |
| 98 | |
| 99 | # side car containers |
| 100 | - name: filebeat-onap |
| 101 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 102 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 103 | volumeMounts: |
| 104 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 105 | subPath: filebeat.yml |
| 106 | name: filebeat-conf |
| 107 | - mountPath: /var/log/onap |
| 108 | name: {{ include "common.fullname" . }}-service-logs |
| 109 | - mountPath: /usr/share/filebeat/data |
| 110 | name: {{ include "common.fullname" . }}-service-filebeat |
| 111 | |
| 112 | volumes: |
| 113 | - name: localtime |
| 114 | hostPath: |
| 115 | path: /etc/localtime |
| 116 | - name: {{ include "common.fullname" . }}-service-config |
| 117 | configMap: |
| 118 | name: {{ include "common.fullname" . }} |
| 119 | - name: {{ include "common.fullname" . }}-service-auth-config |
| 120 | secret: |
| 121 | secretName: {{ include "common.fullname" . }}-keystone |
| 122 | - name: {{ include "common.fullname" . }}-search-policy-config |
| 123 | secret: |
| 124 | secretName: {{ include "common.fullname" . }}-policy |
| 125 | - name: filebeat-conf |
| 126 | configMap: |
| 127 | name: aai-filebeat |
| 128 | - name: {{ include "common.fullname" . }}-service-logs |
| 129 | emptyDir: {} |
| 130 | - name: {{ include "common.fullname" . }}-service-filebeat |
| 131 | emptyDir: {} |
| 132 | - name: {{ include "common.fullname" . }}-service-log-conf |
| 133 | configMap: |
| 134 | name: {{ include "common.fullname" . }}-service-log |
| 135 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
| 136 | imagePullSecrets: |
| 137 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |