blob: 9fd4c4095d2b579f55951c1ff96bc822243a502e [file] [log] [blame]
Jakub Latusekfcf67842020-10-21 13:36:29 +02001{{/*
ac25508ac97172018-04-18 14:23:17 +02002# Copyright © 2017 Amdocs, Bell Canada
Mukul379e2522018-09-05 12:26:02 +00003# Modifications Copyright © 2018 AT&T
ac25508ac97172018-04-18 14:23:17 +02004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latusekfcf67842020-10-21 13:36:29 +020016*/}}
ac25508ac97172018-04-18 14:23:17 +020017
Magdalena_Biernacka7d0dcbe2020-07-12 23:21:43 +020018apiVersion: apps/v1
ac25508ac97172018-04-18 14:23:17 +020019kind: Deployment
20metadata:
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
ac25508ac97172018-04-18 14:23:17 +020027 heritage: {{ .Release.Service }}
28spec:
29 replicas: {{ .Values.replicaCount }}
Magdalena_Biernacka7d0dcbe2020-07-12 23:21:43 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
ac25508ac97172018-04-18 14:23:17 +020033 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
ac25508ac97172018-04-18 14:23:17 +020038 spec:
39 initContainers:
40 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020041 - /app/ready.py
ac25508ac97172018-04-18 14:23:17 +020042 args:
43 - --container-name
44 - clamp-dash-es
45 env:
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020051 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
ac25508ac97172018-04-18 14:23:17 +020052 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 name: {{ include "common.name" . }}-readiness
osgn422w79814452020-09-25 02:28:02 +020054{{ include "common.certInitializer.initContainer" . | indent 6 }}
ac25508ac97172018-04-18 14:23:17 +020055 containers:
56 - name: {{ include "common.name" . }}
Julien Barboted56cca2018-10-22 17:53:07 +020057 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
ac25508ac97172018-04-18 14:23:17 +020058 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
59 env:
60 - name: dmaap_consumer_group
61 value: "{{ .Values.config.dmaapConsumerGroup }}"
62 - name: dmaap_consumer_id
63 value: "{{ .Values.config.dmaapConsumerId }}"
64 - name: event_topic
65 value: "{{ .Values.config.eventTopic }}"
66 - name: notification_topic
67 value: "{{ .Values.config.notificationTopic }}"
68 - name: request_topic
69 value: "{{ .Values.config.requestTopic }}"
70 - name: dmaap_base_url
osgn422wb561a592020-02-11 15:50:21 +010071 value: {{ ternary "https" "http" .Values.security.ssl.enabled }}://{{ .Values.config.dmaapHost }}.{{ include "common.namespace" . }}:{{ .Values.config.dmaapPort }}
osgn422w6e663e42019-08-02 11:31:11 +020072 - name: logstash_user
73 value: "{{ .Values.config.logstash_user }}"
74 - name: logstash_pwd
75 value: "{{ .Values.config.logstash_pwd }}"
ac25508ac97172018-04-18 14:23:17 +020076 - name: elasticsearch_base_url
osgn422wb561a592020-02-11 15:50:21 +010077 value: "{{ ternary "https" "http" .Values.security.ssl.enabled }}://{{.Values.config.elasticsearchServiceName}}.{{.Release.Namespace}}.svc.cluster.local:{{.Values.config.elasticsearchPort}}"
ac25508ac97172018-04-18 14:23:17 +020078 ports:
79 - containerPort: {{ .Values.service.internalPort }}
80 name: {{ include "common.servicename" . }}
81 readinessProbe:
82 tcpSocket:
83 port: {{ .Values.service.internalPort }}
84 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
85 periodSeconds: {{ .Values.readiness.periodSeconds }}
osgn422wb561a592020-02-11 15:50:21 +010086 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
ac25508ac97172018-04-18 14:23:17 +020087# disable liveness probe when breakpoints set in debugger
88 # so K8s doesn't restart unresponsive container
89 {{- if eq .Values.liveness.enabled true }}
90 livenessProbe:
91 tcpSocket:
92 port: {{ .Values.service.internalPort }}
93 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.liveness.periodSeconds }}
osgn422wb561a592020-02-11 15:50:21 +010095 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
ac25508ac97172018-04-18 14:23:17 +020096 {{ end -}}
osgn422w79814452020-09-25 02:28:02 +020097 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
ac25508ac97172018-04-18 14:23:17 +020098 - mountPath: /etc/localtime
99 name: localtime
100 readOnly: true
101 - mountPath: /usr/share/logstash/config/logstash.yml
102 name: {{ include "common.fullname" . }}
103 subPath: logstash.yml
104 - mountPath: /usr/share/logstash/pipeline/logstash.conf
105 name: {{ include "common.fullname" . }}
106 subPath: pipeline.conf
107 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000108{{ include "common.resources" . | indent 12 }}
ac25508ac97172018-04-18 14:23:17 +0200109 {{- if .Values.nodeSelector }}
110 nodeSelector:
111{{ toYaml .Values.nodeSelector | indent 10 }}
112 {{- end -}}
113 {{- if .Values.affinity }}
114 affinity:
115{{ toYaml .Values.affinity | indent 10 }}
116 {{- end }}
osgn422w79814452020-09-25 02:28:02 +0200117 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
ac25508ac97172018-04-18 14:23:17 +0200118 - name: localtime
119 hostPath:
120 path: /etc/localtime
121 - name: {{ include "common.fullname" . }}
122 configMap:
123 name: {{ include "common.fullname" . }}
124 items:
125 - key: logstash.yml
126 path: logstash.yml
127 - key: pipeline.conf
128 path: pipeline.conf
ac25508ac97172018-04-18 14:23:17 +0200129 imagePullSecrets:
130 - name: "{{ include "common.namespace" . }}-docker-registry-key"