Upgrade APPC to use common mariadb galera charts
[oom.git] / kubernetes / log / charts / log-logstash / templates / deployment.yaml
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: DaemonSet
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   template:
27     metadata:
28       labels:
29         app: {{ include "common.name" . }}
30         release: {{ .Release.Name }}
31     spec:
32       initContainers:
33       - command:
34         - /root/ready.py
35         args:
36         - --container-name
37         - log-elasticsearch
38         env:
39         - name: NAMESPACE
40           valueFrom:
41             fieldRef:
42               apiVersion: v1
43               fieldPath: metadata.namespace
44         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
45         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46         name: {{ include "common.name" . }}-readiness
47       containers:
48         - name: {{ include "common.name" . }}
49           image: "{{ .Values.global.loggingRepository| default .Values.loggingRepository }}/{{ .Values.image }}"
50           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
51           ports:
52           - containerPort: {{ .Values.service.internalPort }}
53             name: {{ .Values.service.name }}
54           - containerPort: {{ .Values.service.internalPort2 }}
55             name: {{ .Values.service.name2 }}
56           readinessProbe:
57             tcpSocket:
58               port: {{ .Values.service.internalPort }}
59             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
60             periodSeconds: {{ .Values.readiness.periodSeconds }}
61 # disable liveness probe when breakpoints set in debugger
62           # so K8s doesn't restart unresponsive container
63           {{- if eq .Values.liveness.enabled true }}
64           livenessProbe:
65             tcpSocket:
66               port: {{ .Values.service.internalPort }}
67             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
68             periodSeconds: {{ .Values.liveness.periodSeconds }}
69           {{ end -}}
70           env:
71           volumeMounts:
72           - mountPath: /etc/localtime
73             name: localtime
74             readOnly: true
75           - mountPath: /usr/share/logstash/config/
76             name: {{ include "common.fullname" . }}-config
77           - mountPath: /usr/share/logstash/pipeline/
78             name: {{ include "common.fullname" . }}-pipeline
79           resources:
80 {{ toYaml .Values.resources | indent 12 }}
81         {{- if .Values.nodeSelector }}
82         nodeSelector:
83 {{ toYaml .Values.nodeSelector | indent 10 }}
84         {{- end -}}
85         {{- if .Values.affinity }}
86         affinity:
87 {{ toYaml .Values.affinity | indent 10 }}
88         {{- end }}
89       volumes:
90         - name: localtime
91           hostPath:
92             path: /etc/localtime
93         - name: {{ include "common.fullname" . }}-config
94           configMap:
95             name: {{ include "common.fullname" . }}
96             items:
97             - key: logstash.yml
98               path: logstash.yml
99         - name: {{ include "common.fullname" . }}-pipeline
100           configMap:
101             name: {{ include "common.fullname" . }}
102             items:
103             - key: onap-pipeline.conf
104               path: onap-pipeline.conf
105       imagePullSecrets:
106       - name: "{{ include "common.namespace" . }}-docker-registry-key"