Helm charts and apps for pm-setup
[nonrtric/plt/ranpm.git] / install / helm / nrt-pm / charts / dfc / templates / app-statefulset.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: dfc
22   namespace: nonrtric
23   labels:
24     app: dfc
25 spec:
26   replicas: 1
27   serviceName: dfc
28   selector:
29     matchLabels:
30       app: dfc
31   template:
32     metadata:
33       labels:
34         app: dfc
35     spec:
36       volumes:
37         - name: config-truststore
38           configMap:
39             name: dfc-cm-truststore
40         - name: config-cm
41           configMap:
42             name: dfc-cm
43         - name: token-cache-volume
44           emptyDir: {}
45       containers:
46       - name: dfc
47         securityContext:
48           runAsUser: 0     # Need to run as root - needed when writing to hostpath
49         image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-plt-ranpm-datafilecollector:1.0.0
50         #image: o-ran-sc/nonrtric-plt-ranpm-datafilecollector:1.0.0-SNAPSHOT
51         imagePullPolicy: Always
52         #imagePullPolicy: Never
53         ports:
54         - name: http
55           containerPort: 8100
56         volumeMounts:
57         - name: config-truststore
58           mountPath: /opt/app/datafile/config/truststore.jks
59           subPath: truststore.jks
60         - name: config-cm
61           mountPath: /opt/app/datafile/config/application.yaml
62           subPath: application.yaml
63         - mountPath: /token-cache
64           name: token-cache-volume
65         env:
66         - name: APPID
67           valueFrom:
68             fieldRef:
69               fieldPath: metadata.name
70         - name: APPNS
71           valueFrom:
72             fieldRef:
73               fieldPath: metadata.namespace
74         - name: APP_KAFKA_CLIENT-ID
75           value: "datafile-collector.$(APPNS).$(APPID)"
76       - name: auth-token
77         image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1
78         imagePullPolicy: Always
79         env:
80         - name: CREDS_GRANT_TYPE
81           value: client_credentials
82         - name: CREDS_CLIENT_SECRET
83           value: {{ .Values.dfc.clientsecret }}
84         - name: CREDS_CLIENT_ID
85           value: dfc
86         - name: AUTH_SERVICE_URL
87           value: http://keycloak.nonrtric:8080/realms/nonrtric-realm/protocol/openid-connect/token
88         - name: OUTPUT_FILE
89           value: /token-cache/jwt.txt
90
91         volumeMounts:
92         - mountPath: /token-cache
93           name: token-cache-volume
94
95