1ce26acbf91023073a6218f0a19497eefb192691
[nonrtric/plt/rappmanager.git] /
1 {{/*
2 #  ============LICENSE_START===============================================
3 #  Copyright (C) 2025 OpenInfra Foundation Europe. 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 */}}
19
20 apiVersion: apps/v1
21 kind: Deployment
22 metadata:
23   name: {{ include "energy-saving.fullname" . }}
24   labels:
25     {{- include "energy-saving.labels" . | nindent 4 }}
26 spec:
27   {{- if not .Values.autoscaling.enabled }}
28   replicas: {{ .Values.replicaCount }}
29   {{- end }}
30   selector:
31     matchLabels:
32       {{- include "energy-saving.selectorLabels" . | nindent 6 }}
33   template:
34     metadata:
35       {{- with .Values.podAnnotations }}
36       annotations:
37         {{- toYaml . | nindent 8 }}
38       {{- end }}
39       labels:
40         {{- include "energy-saving.selectorLabels" . | nindent 8 }}
41     spec:
42       {{- with .Values.imagePullSecrets }}
43       imagePullSecrets:
44         {{- toYaml . | nindent 8 }}
45       {{- end }}
46       serviceAccountName: {{ include "energy-saving.serviceAccountName" . }}
47       securityContext:
48         {{- toYaml .Values.podSecurityContext | nindent 8 }}
49       containers:
50         - name: {{ .Chart.Name }}
51           securityContext:
52             {{- toYaml .Values.securityContext | nindent 12 }}
53           image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
54           imagePullPolicy: {{ .Values.image.pullPolicy }}
55           ports:
56             - name: http
57               containerPort: {{ .Values.service.port }}
58               protocol: TCP
59           resources:
60             {{- toYaml .Values.resources | nindent 12 }}
61           env:
62             - name: APP_ID
63               value: {{ .Values.environment.appId | quote }}
64             - name: SME_DISCOVERY_ENDPOINT
65               value: {{ .Values.environment.smeDiscoveryEndpoint | quote }}
66           volumeMounts:
67             - mountPath: /app/config.json
68               name: config
69               subPath: config.json
70           command:
71             {{- if .Values.appStartup.command }}
72             {{- toYaml .Values.appStartup.command | nindent 12 }}
73             {{- end }}
74           args:
75             {{- if .Values.appStartup.args }}
76             {{- toYaml .Values.appStartup.args | nindent 12 }}
77             {{- end }}
78       {{- with .Values.nodeSelector }}
79       nodeSelector:
80         {{- toYaml . | nindent 8 }}
81       {{- end }}
82       {{- with .Values.affinity }}
83       affinity:
84         {{- toYaml . | nindent 8 }}
85       {{- end }}
86       {{- with .Values.tolerations }}
87       tolerations:
88         {{- toYaml . | nindent 8 }}
89       {{- end }}
90       volumes:
91         - name: config
92           configMap:
93               name: {{ include "energy-saving.name" . }}-configmap
94               defaultMode: 0755
95               items:
96                 - key: config.json
97                   path: config.json