1bd0309367f2bd031b89ac9eca7eb5979e2d5cdc
[oom.git] / kubernetes / pomba / charts / pomba-networkdiscovery / templates / deployment.yaml
1 # Copyright © 2018 Amdocs\r
2 #\r
3 # Licensed under the Apache License, Version 2.0 (the "License");\r
4 # you may not use this file except in compliance with the License.\r
5 # You may obtain a copy of the License at\r
6 #\r
7 #       http://www.apache.org/licenses/LICENSE-2.0\r
8 #\r
9 # Unless required by applicable law or agreed to in writing, software\r
10 # distributed under the License is distributed on an "AS IS" BASIS,\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
12 # See the License for the specific language governing permissions and\r
13 # limitations under the License.\r
14 \r
15 apiVersion: extensions/v1beta1\r
16 kind: Deployment\r
17 metadata:\r
18   name: {{ include "common.fullname" . }}\r
19   namespace: {{ include "common.namespace" . }}\r
20   labels:\r
21     app: {{ include "common.name" . }}\r
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}\r
23     release: {{ .Release.Name }}\r
24     heritage: {{ .Release.Service }}\r
25 spec:\r
26   replicas: {{ .Values.replicaCount }}\r
27   template:\r
28     metadata:\r
29       labels:\r
30         app: {{ include "common.name" . }}\r
31         release: {{ .Release.Name }}\r
32     spec:\r
33       containers:\r
34         - name: {{ include "common.name" . }}\r
35           image: "{{ include "common.repository" . }}/{{ .Values.image }}"\r
36           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}\r
37           ports:\r
38           - containerPort: {{ .Values.service.internalPort }}\r
39           # disable liveness probe when breakpoints set in debugger\r
40           # so K8s doesn't restart unresponsive container\r
41           {{ if .Values.liveness.enabled }}\r
42           livenessProbe:\r
43             tcpSocket:\r
44               port: {{ .Values.service.internalPort }}\r
45             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}\r
46             periodSeconds: {{ .Values.liveness.periodSeconds }}\r
47           {{ end }}\r
48           readinessProbe:\r
49             tcpSocket:\r
50               port: {{ .Values.service.internalPort }}\r
51             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}\r
52             periodSeconds: {{ .Values.readiness.periodSeconds }}\r
53           env:\r
54           volumeMounts:\r
55           - mountPath: /etc/localtime\r
56             name: localtime\r
57             readOnly: true\r
58           - name: {{ include "common.fullname" . }}-logs\r
59             mountPath: /var/log/onap\r
60           - mountPath: /opt/app/config/logback.xml\r
61             name: {{ include "common.fullname" . }}-log-conf\r
62             subPath: logback.xml\r
63           - mountPath: /opt/app/config/application.properties\r
64             name: {{ include "common.fullname" . }}-config\r
65             subPath: application.properties\r
66             readOnly: true\r
67           - mountPath: /opt/app/config/auth/enricher-client-cert.p12\r
68             name: {{ include "common.fullname" . }}-auth-secret\r
69             subPath: enricher-client-cert.p12\r
70             readOnly: true\r
71 \r
72           resources:\r
73 {{ toYaml .Values.resources | indent 12 }}\r
74         {{- if .Values.nodeSelector }}\r
75         nodeSelector:\r
76 {{ toYaml .Values.nodeSelector | indent 10 }}\r
77         {{- end -}}\r
78         {{- if .Values.affinity }}\r
79         affinity:\r
80 {{ toYaml .Values.affinity | indent 10 }}\r
81         {{- end }}\r
82 \r
83         # Filebeat sidecar container\r
84         - name: {{ include "common.name" . }}-filebeat-onap\r
85           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"\r
86           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}\r
87           volumeMounts:\r
88           - name: {{ include "common.fullname" . }}-filebeat-conf\r
89             mountPath: /usr/share/filebeat/filebeat.yml\r
90             subPath: filebeat.yml\r
91           - name: {{ include "common.fullname" . }}-data-filebeat\r
92             mountPath: /usr/share/filebeat/data\r
93           - name: {{ include "common.fullname" . }}-logs\r
94             mountPath: /var/log/onap\r
95 \r
96       volumes:\r
97         - name: localtime\r
98           hostPath:\r
99             path: /etc/localtime\r
100         - name:  {{ include "common.fullname" . }}-logs\r
101           emptyDir: {}\r
102         - name: {{ include "common.fullname" . }}-log-conf\r
103           configMap:\r
104             name: {{ include "common.fullname" . }}-log\r
105         - name: {{ include "common.fullname" . }}-config\r
106           configMap:\r
107             name: {{ include "common.fullname" . }}-configmap\r
108         - name: {{ include "common.fullname" . }}-auth-secret\r
109           secret:\r
110             secretName: {{ include "common.fullname" . }}-auth\r
111         - name: {{ include "common.fullname" . }}-filebeat-conf\r
112           configMap:\r
113             name: {{ .Release.Name }}-pomba-filebeat-configmap\r
114         - name: {{ include "common.fullname" . }}-data-filebeat\r
115           emptyDir: {}\r
116 \r
117       imagePullSecrets:\r
118       - name: "{{ include "common.namespace" . }}-docker-registry-key"\r