blob: 0811563cef2a3fdd9e6e658de9dc475df6087dd4 [file] [log] [blame]
BorislavG5f3b6192018-03-25 18:12:38 +03001# 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
15apiVersion: extensions/v1beta1
Michael O'Brien286725f2018-05-18 01:51:02 -040016kind: DaemonSet
BorislavG5f3b6192018-03-25 18:12:38 +030017metadata:
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 }}
25spec:
BorislavG5f3b6192018-03-25 18:12:38 +030026 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 }}
BorislavG2cf26842018-04-08 17:50:07 +030054 - containerPort: {{ .Values.service.internalPort2 }}
55 name: {{ .Values.service.name2 }}
BorislavG5f3b6192018-03-25 18:12:38 +030056 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
root4565d0a2018-04-04 17:21:02 +000075 - mountPath: /usr/share/logstash/config/
76 name: {{ include "common.fullname" . }}-config
77 - mountPath: /usr/share/logstash/pipeline/
78 name: {{ include "common.fullname" . }}-pipeline
BorislavG5f3b6192018-03-25 18:12:38 +030079 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
root4565d0a2018-04-04 17:21:02 +000093 - name: {{ include "common.fullname" . }}-config
BorislavG5f3b6192018-03-25 18:12:38 +030094 configMap:
95 name: {{ include "common.fullname" . }}
96 items:
97 - key: logstash.yml
98 path: logstash.yml
root4565d0a2018-04-04 17:21:02 +000099 - name: {{ include "common.fullname" . }}-pipeline
100 configMap:
101 name: {{ include "common.fullname" . }}
102 items:
BorislavG5f3b6192018-03-25 18:12:38 +0300103 - key: onap-pipeline.conf
104 path: onap-pipeline.conf
105 imagePullSecrets:
106 - name: "{{ include "common.namespace" . }}-docker-registry-key"