6513ee2a6819b0a671abc8cb3711e20ea83614f4
[oom.git] / kubernetes / multicloud / components / multicloud-k8s / templates / deployment.yaml
1 {{/*
2 # Copyright 2019 Intel Corporation, Inc
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 */}}
16
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   selector: {{- include "common.selectors" . | nindent 4 }}
22   replicas: {{ .Values.replicaCount }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       containers:
27       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
28         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
29         name: {{ include "common.name" . }}
30         command: ["/opt/multicloud/k8splugin/k8plugin"]
31         workingDir: /opt/multicloud/k8splugin
32         ports: {{ include "common.containerPorts" . | nindent 10  }}
33         {{- if eq .Values.liveness.enabled true }}
34         livenessProbe:
35           tcpSocket:
36             port: {{ .Values.service.internalPort }}
37           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
38           periodSeconds: {{ .Values.liveness.periodSeconds }}
39         {{ end -}}
40         readinessProbe:
41           tcpSocket:
42             port: {{ .Values.service.internalPort }}
43           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
44           periodSeconds: {{ .Values.readiness.periodSeconds }}
45         volumeMounts:
46           - mountPath: /etc/localtime
47             name: localtime
48             readOnly: true
49           - mountPath: /opt/multicloud/k8splugin/k8sconfig.json
50             name: {{ include "common.name" .}}
51             subPath: k8sconfig.json
52         resources: {{ include "common.resources" . | nindent 10 }}
53         {{- if .Values.nodeSelector }}
54         nodeSelector:
55 {{ toYaml .Values.nodeSelector | indent 10 }}
56         {{- end -}}
57         {{- if .Values.affinity }}
58         affinity:
59 {{ toYaml .Values.affinity | indent 10 }}
60         {{- end }}
61       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.artifactImage }}
62         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63         name: framework-artifactbroker
64         command: ["/opt/app/distribution/bin/artifact-dist.sh"]
65         args: ["/opt/app/distribution/etc/mounted/config.json"]
66         ports:
67         - containerPort: {{ .Values.artifactbroker.internalPort }}
68           protocol: TCP
69         volumeMounts:
70         - mountPath: /opt/app/distribution/etc/mounted/config.json
71           name: {{ include "common.name" .}}
72           subPath: config.json
73         - mountPath: /data
74           name: artifact-data
75         env:
76         - name: SASL_JAAS_CONFIG
77           valueFrom:
78             secretKeyRef:
79               name: {{ include "common.name" . }}-ku
80               key: sasl.jaas.config
81       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
82       volumes:
83       - name: localtime
84         hostPath:
85           path: /etc/localtime
86       - name : {{ include "common.name" . }}
87         configMap:
88           name: {{ include "common.fullname" . }}
89       - name: artifact-data
90         emptyDir: {}
91       {{- include "common.imagePullSecrets" . | nindent 6 }}