blob: 83a4975aa5332c6813d72638c495a07ceacccaca [file] [log] [blame]
Fiachra Corcoranbe966552018-08-07 16:58:45 +01001# 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.
14apiVersion: extensions/v1beta1
15kind: Deployment
16metadata:
17 name: {{ include "common.fullname" . }}
18 namespace: {{ include "common.namespace" . }}
19 labels:
20 app: {{ include "common.name" . }}
21 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
22 release: {{ .Release.Name }}
23 heritage: {{ .Release.Service }}
24spec:
25 replicas: {{ .Values.replicaCount }}
26 template:
27 metadata:
28 labels:
29 app: {{ include "common.name" . }}
30 release: {{ .Release.Name }}
31 spec:
econwar28266fa2019-03-05 16:39:00 +000032 hostname: {{.Values.config.dmaapDrNode.name}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010033 initContainers:
34 - name: {{ include "common.name" . }}-readiness
35 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
36 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37 command:
38 - /root/ready.py
39 args:
40 - --container-name
econwar28266fa2019-03-05 16:39:00 +000041 - dmaap-dr-prov
Fiachra Corcoranbe966552018-08-07 16:58:45 +010042 env:
43 - name: NAMESPACE
44 valueFrom:
45 fieldRef:
46 apiVersion: v1
47 fieldPath: metadata.namespace
48 containers:
49 - name: {{ include "common.name" . }}
50 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 ports:
econwar28266fa2019-03-05 16:39:00 +000053 - containerPort: {{.Values.config.dmaapDrNode.externalPort}}
54 - containerPort: {{.Values.config.dmaapDrNode.externalPort2}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010055 {{- if eq .Values.liveness.enabled true }}
56 livenessProbe:
57 tcpSocket:
econwar28266fa2019-03-05 16:39:00 +000058 port: {{.Values.config.dmaapDrNode.internalPort}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010059 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.liveness.periodSeconds }}
61 {{ end -}}
62 readinessProbe:
63 tcpSocket:
econwar28266fa2019-03-05 16:39:00 +000064 port: {{.Values.config.dmaapDrNode.internalPort}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010065 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66 periodSeconds: {{ .Values.readiness.periodSeconds }}
67 volumeMounts:
68 - mountPath: /etc/localtime
69 name: localtime
70 readOnly: false
71 - mountPath: /opt/app/datartr/etc/dedicatedFeed.json
72 subPath: dedicatedFeed.json
73 name: create-feed
74 - mountPath: /opt/app/datartr/etc/createFeed.sh
75 subPath: createFeed.sh
76 name: create-feed
77 - mountPath: /opt/app/datartr/etc/node.properties
78 subPath: node.properties
79 name: node-props
econwar378cf192019-01-08 16:19:59 +000080 - name: {{ include "common.fullname" . }}-logs
81 mountPath: {{ .Values.global.loggingDirectory }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010082 lifecycle:
83 postStart:
84 exec:
85 command:
86 - /opt/app/datartr/etc/createFeed.sh
87 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000088{{ include "common.resources" . | indent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010089 {{- if .Values.nodeSelector }}
90 nodeSelector:
91{{ toYaml .Values.nodeSelector | indent 10 }}
92 {{- end -}}
93 {{- if .Values.affinity }}
94 affinity:
95{{ toYaml .Values.affinity | indent 10 }}
96 {{- end }}
econwar378cf192019-01-08 16:19:59 +000097
98 # Filebeat sidecar container
99 - name: {{ include "common.name" . }}-filebeat-onap
100 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
101 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
102 volumeMounts:
103 - name: {{ include "common.fullname" . }}-filebeat-conf
104 mountPath: /usr/share/filebeat/filebeat.yml
105 subPath: filebeat.yml
106 - name: {{ include "common.fullname" . }}-data-filebeat
107 mountPath: /usr/share/filebeat/data
108 - name: {{ include "common.fullname" . }}-logs
109 mountPath: /var/log/onap/datarouter-node
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100110 volumes:
111 - name: localtime
112 hostPath:
113 path: /etc/localtime
114 - name: create-feed
115 configMap:
116 name: {{ include "common.fullname" . }}-create-feed-configmap
117 defaultMode: 0755
118 - name: node-props
119 configMap:
120 name: {{ include "common.fullname" . }}-node-props-configmap
121 - name: dr-node-data
122 {{- if .Values.persistence.enabled }}
123 persistentVolumeClaim:
124 claimName: {{ include "common.fullname" . }}
125 {{- else }}
126 emptyDir: {}
127 {{- end }}
econwar378cf192019-01-08 16:19:59 +0000128 - name: {{ include "common.fullname" . }}-log-conf
129 configMap:
130 name: {{ include "common.fullname" . }}-log
131 - name: {{ include "common.fullname" . }}-filebeat-conf
132 configMap:
133 name: {{ .Release.Name }}-dmaap-filebeat-configmap
134 - name: {{ include "common.fullname" . }}-data-filebeat
135 emptyDir: {}
136 - name: {{ include "common.fullname" . }}-logs
137 emptyDir: {}
Sylvain Desbureaux789d79a2018-12-20 11:04:34 +0100138 imagePullSecrets:
139 - name: "{{ include "common.namespace" . }}-docker-registry-key"