Updated installation and components
[nonrtric/plt/ranpm.git] / install / helm / ran / templates / app-deployment.yaml
1 #  ============LICENSE_START===============================================
2 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
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 #  ============LICENSE_END=================================================
16 #
17
18 apiVersion: apps/v1
19 kind: StatefulSet
20 metadata:
21   name: pm-https-server
22   namespace: ran
23   labels:
24     app: pm-https-server
25 spec:
26   replicas: {{ .Values.global.numhttpsservers }}    # Max 10 = number of generated unique certs  ...
27   serviceName: pm-https-server
28   selector:
29     matchLabels:
30       app: pm-https-server
31   template:
32     metadata:
33       labels:
34         app: pm-https-server
35     spec:
36       volumes:
37         - name: tmp-vol
38           configMap:
39             name: pm-https-server-cm
40         - name: cert-vol
41           emptyDir: {}
42         - name: ne-files-vol
43           configMap:
44             name: ne-files
45         - name: template-files-vol
46           configMap:
47             name: template-files
48       initContainers:
49       - name: init
50         image: alpine:latest
51         imagePullPolicy: IfNotPresent
52         command: ["ash","-c"]
53         args: ["cp /tmp/certs/copy-certs.sh /tmp && cd /tmp && chmod u+x copy-certs.sh && ./copy-certs.sh"]
54         volumeMounts:
55         - name: tmp-vol
56           mountPath: /tmp/certs
57         - name: cert-vol
58           mountPath: /certs
59         securityContext:
60           runAsUser: 0
61       containers:
62       - name: pm-https-server
63         image: {{ .Values.global.extimagerepo }}pm-https-server:latest
64         {{- if .Values.global.extimagerepo }}
65         imagePullPolicy: Always
66         {{- else }}
67         imagePullPolicy: Never
68         {{- end }}
69         ports:
70         - name: http
71           containerPort: 80
72         - name: https
73           containerPort: 443
74         env:
75         # If env is specified, the given file is returned for any call to the "/files/<filename>"" url
76         # If env is missing, the file in the call to "/files/<filename> url must exist in the server
77         - name: ALWAYS_RETURN
78           value: /ne-files/pm.xml.gz
79         # Env must be specified if generated files use. The value shall specify the first timestamp of a series of pm files
80         # If a file with a timestamp less than the below will return 404
81         # Timestamp shall be given with date.time where minutes has values 00,15,45 and the given timezone
82         # Example: 20230220.1300 - denotes a first file name of 20230220.1300+0100-1315+0100_<node-name>.xml.gz
83         - name: GENERATED_FILE_START_TIME
84           value: "20230515.0700"
85         # Timezone to use for generated files. If not given, timezone 0000 will be used
86         # Shall include +/- sign for the timezone value
87         - name: GENERATED_FILE_TIMEZONE
88           value: "+0100"
89         volumeMounts:
90         - name: cert-vol
91           mountPath: /certs
92         - name: tmp-vol
93           mountPath: /tmp/certs
94         - name: ne-files-vol
95           mountPath: /ne-files
96         - name: template-files-vol
97           mountPath: /template-files