blob: 7c5c047930bf260f38f32a37778c9d8377a50bf8 [file] [log] [blame]
ac25508ac97172018-04-18 14:23:17 +02001# Copyright © 2017 Amdocs, Bell Canada
Mukul379e2522018-09-05 12:26:02 +00002# Modifications Copyright © 2018 AT&T
ac25508ac97172018-04-18 14:23:17 +02003#
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.
ac25508ac97172018-04-18 14:23:17 +020015
16apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
ac25508ac97172018-04-18 14:23:17 +020025 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
ac25508ac97172018-04-18 14:23:17 +020033 spec:
34 initContainers:
35 - command:
36 - /root/ready.py
37 args:
38 - --container-name
39 - clamp-dash-es
40 env:
41 - name: NAMESPACE
42 valueFrom:
43 fieldRef:
44 apiVersion: v1
45 fieldPath: metadata.namespace
46 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
47 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48 name: {{ include "common.name" . }}-readiness
49 containers:
50 - name: {{ include "common.name" . }}
Julien Barboted56cca2018-10-22 17:53:07 +020051 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
ac25508ac97172018-04-18 14:23:17 +020052 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 env:
54 - name: dmaap_consumer_group
55 value: "{{ .Values.config.dmaapConsumerGroup }}"
56 - name: dmaap_consumer_id
57 value: "{{ .Values.config.dmaapConsumerId }}"
58 - name: event_topic
59 value: "{{ .Values.config.eventTopic }}"
60 - name: notification_topic
61 value: "{{ .Values.config.notificationTopic }}"
62 - name: request_topic
63 value: "{{ .Values.config.requestTopic }}"
64 - name: dmaap_base_url
osgn422wb561a592020-02-11 15:50:21 +010065 value: {{ ternary "https" "http" .Values.security.ssl.enabled }}://{{ .Values.config.dmaapHost }}.{{ include "common.namespace" . }}:{{ .Values.config.dmaapPort }}
osgn422w6e663e42019-08-02 11:31:11 +020066 - name: logstash_user
67 value: "{{ .Values.config.logstash_user }}"
68 - name: logstash_pwd
69 value: "{{ .Values.config.logstash_pwd }}"
ac25508ac97172018-04-18 14:23:17 +020070 - name: elasticsearch_base_url
osgn422wb561a592020-02-11 15:50:21 +010071 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 +020072 ports:
73 - containerPort: {{ .Values.service.internalPort }}
74 name: {{ include "common.servicename" . }}
75 readinessProbe:
76 tcpSocket:
77 port: {{ .Values.service.internalPort }}
78 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.readiness.periodSeconds }}
osgn422wb561a592020-02-11 15:50:21 +010080 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
ac25508ac97172018-04-18 14:23:17 +020081# disable liveness probe when breakpoints set in debugger
82 # so K8s doesn't restart unresponsive container
83 {{- if eq .Values.liveness.enabled true }}
84 livenessProbe:
85 tcpSocket:
86 port: {{ .Values.service.internalPort }}
87 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
88 periodSeconds: {{ .Values.liveness.periodSeconds }}
osgn422wb561a592020-02-11 15:50:21 +010089 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
ac25508ac97172018-04-18 14:23:17 +020090 {{ end -}}
91 volumeMounts:
92 - mountPath: /etc/localtime
93 name: localtime
94 readOnly: true
95 - mountPath: /usr/share/logstash/config/logstash.yml
96 name: {{ include "common.fullname" . }}
97 subPath: logstash.yml
98 - mountPath: /usr/share/logstash/pipeline/logstash.conf
99 name: {{ include "common.fullname" . }}
100 subPath: pipeline.conf
101 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000102{{ include "common.resources" . | indent 12 }}
ac25508ac97172018-04-18 14:23:17 +0200103 {{- if .Values.nodeSelector }}
104 nodeSelector:
105{{ toYaml .Values.nodeSelector | indent 10 }}
106 {{- end -}}
107 {{- if .Values.affinity }}
108 affinity:
109{{ toYaml .Values.affinity | indent 10 }}
110 {{- end }}
111 volumes:
112 - name: localtime
113 hostPath:
114 path: /etc/localtime
115 - name: {{ include "common.fullname" . }}
116 configMap:
117 name: {{ include "common.fullname" . }}
118 items:
119 - key: logstash.yml
120 path: logstash.yml
121 - key: pipeline.conf
122 path: pipeline.conf
ac25508ac97172018-04-18 14:23:17 +0200123 imagePullSecrets:
124 - name: "{{ include "common.namespace" . }}-docker-registry-key"