4c9dffcd9baf5a0e04b588a19f2dd95df4efecbc
[dcaegen2/services.git] /
1 # ============LICENSE_START==========================================
2 # ===================================================================
3 #  Copyright (c) 2020 QCT
4 #
5 #  Licensed under the Apache License, Version 2.0 (the "License");
6 #  you may not use this file except in compliance with the License.
7 #  You may obtain a copy of the License at
8 #
9 #         http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #============LICENSE_END============================================
17
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata:
21   name: {{ include "dcae-datalake-feeder.fullname" . }}
22   namespace: {{ .Release.Namespace }}
23   labels:
24 {{ include "dcae-datalake-feeder.labels" . | indent 4 }}
25 spec:
26   hostname: dcae-datalake-feeder-feeder
27   replicas: {{ .Values.replicaCount }}
28   selector:
29     matchLabels:
30       app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }}
31       app.kubernetes.io/instance: {{ .Release.Name }}
32   template:
33     metadata:
34       labels:
35         app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }}
36         app.kubernetes.io/instance: {{ .Release.Name }}
37     spec:
38     {{- with .Values.imagePullSecrets }}
39       imagePullSecrets:
40         {{- toYaml . | nindent 8 }}
41     {{- end }}
42       initContainers:
43       - command:
44         - /root/job_complete.py
45         args:
46         - -j
47         - {{ .Release.Name }}-dcae-datalake-feeder-dbinit-job
48         env:
49         - name: NAMESPACE
50           valueFrom:
51             fieldRef:
52               apiVersion: v1
53               fieldPath: metadata.namespace
54         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
55         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56         name: datalake-readiness
57       containers:
58         - name: {{ .Chart.Name }}
59           image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
60           imagePullPolicy: {{ .Values.image.pullPolicy }}
61           env:
62           - name: HOSTNAME
63             value: k8s-datalake
64           - name: CONSUL_HOST
65             value: consul
66           - name: CONFIG_BINDING_SERVICE
67             value: config-binding-service      
68           ports:
69             - name: http
70               containerPort: 1680
71               protocol: TCP
72           livenessProbe:
73             httpGet:
74               path: /
75               port: http
76           resources:
77             {{- toYaml .Values.resources | nindent 12 }}
78           volumeMounts:
79             - name: config-volume
80               mountPath: /etc/datalake
81       volumes:
82         - name: config-volume
83           configMap:
84             name: {{ .Release.Name }}-dcae-datalake-feeder-configmap
85       {{- with .Values.nodeSelector }}
86       nodeSelector:
87         {{- toYaml . | nindent 8 }}
88       {{- end }}
89     {{- with .Values.affinity }}
90       affinity:
91         {{- toYaml . | nindent 8 }}
92     {{- end }}
93     {{- with .Values.tolerations }}
94       tolerations:
95         {{- toYaml . | nindent 8 }}
96     {{- end }}