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