Helm charts and apps for pm-setup
[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: 1    # Max 10 = number of generated certs unique ...
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: pm-https-server:latest
64         imagePullPolicy: Never
65         ports:
66         - name: http
67           containerPort: 80
68         - name: https
69           containerPort: 443
70         env:
71         # If env is specified, the given file is returned for any call to the "/files/<filename>"" url
72         # If env is missing, the file in the call to "/files/<filename> url must exist in the server
73         - name: ALWAYS_RETURN
74           value: /ne-files/pm.xml.gz
75         # Env must be specified if genetated files use. The value shall spefify the first timestamp of a series of pm files
76         # If a file with a timestamp less than the below will return 404
77         # Timestamp shall be gvien with date.time where minutes has values 00,15,45 and the given timezone
78         # Example: 20230220.1300 - denotes a first file name of 20230220.1300+0100-1315+0100_<node-name>.xml.gz
79         - name: GENERATED_FILE_START_TIME
80           value: "20230220.1300"
81         # Timezone to use for generated files. If not given, timezone 0000 will be used
82         # Shall include +/- sign for the timezone value
83         - name: GENERATED_FILE_TIMEZONE
84           value: "+0100"
85         volumeMounts:
86         - name: cert-vol
87           mountPath: /certs
88         - name: tmp-vol
89           mountPath: /tmp/certs
90         - name: ne-files-vol
91           mountPath: /ne-files
92         - name: template-files-vol
93           mountPath: /template-files