ddf5157ccf139425ed0a152f859a6ee67e135a51
[nonrtric/plt/ranpm.git] / install / helm / controlpanel / templates / deployment.yaml
1 ################################################################################
2 #   Copyright (c) 2023 Nordix Foundation.                                      #
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 kind: Deployment
18 apiVersion: apps/v1
19 metadata:
20   name: controlpanel
21   namespace: nonrtric
22   labels:
23     app: nonrtric-controlpanel
24 spec:
25   replicas: {{ .Values.controlpanel.replicaCount }}
26   selector:
27     matchLabels:
28       app: nonrtric-controlpanel
29   template:
30     metadata:
31       labels:
32         app: nonrtric-controlpanel
33     spec:
34       containers:
35         - name: controlpanel
36           image: "{{ .Values.controlpanel.image.registry }}/{{ .Values.controlpanel.image.name }}:{{ .Values.controlpanel.image.tag }}"
37           imagePullPolicy: {{ .Values.controlpanel.imagePullPolicy }}
38           ports:
39           - containerPort: {{ .Values.controlpanel.service.targetPort1 }}
40             protocol: TCP
41           - containerPort: {{ .Values.controlpanel.service.targetPort2 }}
42             protocol: TCP
43           volumeMounts:
44             - name: controlpanel-configmap
45               mountPath: /etc/nginx/nginx.conf
46               subPath: nginx.conf
47               readOnly: true
48           readinessProbe:
49             tcpSocket:
50               port: {{ .Values.controlpanel.service.targetPort1 }}
51             initialDelaySeconds: {{ .Values.controlpanel.readiness.initialDelaySeconds }} # liveness -> readiness
52             periodSeconds: {{ .Values.controlpanel.readiness.periodSeconds }} # liveness -> readiness
53           livenessProbe:
54             tcpSocket:
55               port: {{ .Values.controlpanel.service.targetPort1 }}
56             initialDelaySeconds: {{ .Values.controlpanel.liveness.initialDelaySeconds }}
57             periodSeconds: {{ .Values.controlpanel.liveness.periodSeconds }}
58       volumes:
59         - name: controlpanel-configmap
60           configMap:
61             name: controlpanel-configmap