[DCAE][DCAEMOD] Deploy R7 container images
[oom.git] / kubernetes / dcaemod / components / dcaemod-healthcheck / templates / deployment.yaml
1 #============LICENSE_START========================================================
2 # ================================================================================
3 # Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
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: {{- include "common.resourceMetadata" . | nindent 2 }}
21 spec:
22   selector: {{- include "common.selectors" . | nindent 4 }}
23   replicas: 1
24   template:
25     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26     spec:
27       containers:
28         - name: {{ include "common.name" . }}
29           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
30           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
31           resources:
32 {{ include "common.resources" . | indent 12 }}
33           ports: {{ include "common.containerPorts" . | nindent 10  }}
34           # disable liveness probe when breakpoints set in debugger
35           # so K8s doesn't restart unresponsive container
36           {{- if eq .Values.liveness.enabled true }}
37           livenessProbe:
38             tcpSocket:
39               port: {{ ( index .Values.service.ports 0).port }}
40             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
41             periodSeconds: {{ .Values.liveness.periodSeconds }}
42           {{ end -}}
43           readinessProbe:
44             tcpSocket:
45               port: {{ ( index .Values.service.ports 0).port }}
46             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
47             periodSeconds: {{ .Values.readiness.periodSeconds }}
48           volumeMounts:
49             - mountPath: /opt/app/expected-components.json
50               subPath: expected-components.json
51               name: {{ include "common.fullname" .}}-expected-components
52           env:
53             - name: DCAE_NAMESPACE
54               value: {{ .Values.dcae_ns }}
55             - name: ONAP_NAMESPACE
56               value: {{ include "common.namespace" . }}
57             - name: HELM_RELEASE
58               value: {{ include "common.release" . }}
59       volumes:
60         - name: {{ include "common.fullname" . }}-expected-components
61           configMap:
62             name: {{ include "common.release" . }}-dcaemod-expected-components
63       imagePullSecrets:
64       - name: "{{ include "common.namespace" . }}-docker-registry-key"