blob: 3cfdae3aebdd4598c14752dbf83cf5a88193f067 [file] [log] [blame]
ac25508ac97172018-04-18 14:23:17 +02001# 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# Modifications copyright (c) 2018 AT&T Intellectual Property
16
17apiVersion: extensions/v1beta1
18kind: Deployment
19metadata:
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25 release: {{ .Release.Name }}
26 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
33 release: {{ .Release.Name }}
34 spec:
35 initContainers:
36 - command:
37 - /root/ready.py
38 args:
39 - --container-name
40 - clamp-dash-es
41 env:
42 - name: NAMESPACE
43 valueFrom:
44 fieldRef:
45 apiVersion: v1
46 fieldPath: metadata.namespace
47 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
48 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49 name: {{ include "common.name" . }}-readiness
50 containers:
51 - name: {{ include "common.name" . }}
52 image: "{{ .Values.global.loggingRepository| default .Values.loggingRepository }}/{{ .Values.image }}"
53 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 env:
55 - name: dmaap_consumer_group
56 value: "{{ .Values.config.dmaapConsumerGroup }}"
57 - name: dmaap_consumer_id
58 value: "{{ .Values.config.dmaapConsumerId }}"
59 - name: event_topic
60 value: "{{ .Values.config.eventTopic }}"
61 - name: notification_topic
62 value: "{{ .Values.config.notificationTopic }}"
63 - name: request_topic
64 value: "{{ .Values.config.requestTopic }}"
65 - name: dmaap_base_url
66 value: {{ .Values.config.dmaapScheme }}://{{ .Values.config.dmaapHost }}.{{ include "common.namespace" . }}:{{ .Values.config.dmaapPort }}
67 - name: elasticsearch_base_url
68 value: "http://{{.Values.config.elasticsearchServiceName}}.{{.Release.Namespace}}.svc.cluster.local:{{.Values.config.elasticsearchPort}}"
69 ports:
70 - containerPort: {{ .Values.service.internalPort }}
71 name: {{ include "common.servicename" . }}
72 readinessProbe:
73 tcpSocket:
74 port: {{ .Values.service.internalPort }}
75 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
76 periodSeconds: {{ .Values.readiness.periodSeconds }}
77# disable liveness probe when breakpoints set in debugger
78 # so K8s doesn't restart unresponsive container
79 {{- if eq .Values.liveness.enabled true }}
80 livenessProbe:
81 tcpSocket:
82 port: {{ .Values.service.internalPort }}
83 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
84 periodSeconds: {{ .Values.liveness.periodSeconds }}
85 {{ end -}}
86 volumeMounts:
87 - mountPath: /etc/localtime
88 name: localtime
89 readOnly: true
90 - mountPath: /usr/share/logstash/config/logstash.yml
91 name: {{ include "common.fullname" . }}
92 subPath: logstash.yml
93 - mountPath: /usr/share/logstash/pipeline/logstash.conf
94 name: {{ include "common.fullname" . }}
95 subPath: pipeline.conf
96 resources:
97{{ toYaml .Values.resources | indent 12 }}
98 {{- if .Values.nodeSelector }}
99 nodeSelector:
100{{ toYaml .Values.nodeSelector | indent 10 }}
101 {{- end -}}
102 {{- if .Values.affinity }}
103 affinity:
104{{ toYaml .Values.affinity | indent 10 }}
105 {{- end }}
106 volumes:
107 - name: localtime
108 hostPath:
109 path: /etc/localtime
110 - name: {{ include "common.fullname" . }}
111 configMap:
112 name: {{ include "common.fullname" . }}
113 items:
114 - key: logstash.yml
115 path: logstash.yml
116 - key: pipeline.conf
117 path: pipeline.conf
118 imagePullSecrets:
119 - name: "{{ include "common.namespace" . }}-docker-registry-key"