I-Relese - Update versions for RANPM
[nonrtric/plt/ranpm.git] / install / helm / nrt-pm / charts / pm-producer-json2kafka / 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
20 apiVersion: apps/v1
21 kind: StatefulSet
22 metadata:
23   name: pm-producer-json2kafka
24   namespace: nonrtric
25   labels:
26     app: pm-producer-json2kafka
27 spec:
28   replicas: 1
29   serviceName: pm-producer-json2kafka
30   selector:
31     matchLabels:
32       app: pm-producer-json2kafka
33   template:
34     metadata:
35       labels:
36         app: pm-producer-json2kafka
37     spec:
38       containers:
39       - name: pm-producer-json2kafka
40         image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-pmproducer:1.1.0
41         imagePullPolicy: Always
42         ports:
43         - name: http
44           containerPort: 8084
45         env:
46         - name: APPID
47           valueFrom:
48             fieldRef:
49               fieldPath: metadata.name
50         - name: APPNS
51           valueFrom:
52             fieldRef:
53               fieldPath: metadata.namespace
54         # Overriding value in application.yaml
55         - name: APP_PM-PRODUCER-BASE-URL
56           value: "http://$(APPID).pm-producer-json2kafka.$(APPNS):8084"
57         volumeMounts:
58         - mountPath: /opt/app/pm-producer-service/data/application_configuration.json
59           subPath: application_configuration.json
60           name: pm-producer-json2kafka-cm-data
61         - mountPath: /opt/app/pm-producer-service/config/application.yaml
62           subPath: application.yaml
63           name: pm-producer-json2kafka-cm-config
64         - mountPath: /token-cache
65           name: token-cache-volume
66       - name: auth-token
67         image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1
68         imagePullPolicy: Always
69         env:
70         - name: CREDS_GRANT_TYPE
71           value: client_credentials
72         - name: CREDS_CLIENT_SECRET
73           value: {{ .Values.pmproducerjson2kafka.clientsecret }}
74         - name: CREDS_CLIENT_ID
75           value: pm-producer-json2kafka
76         - name: AUTH_SERVICE_URL
77           value: http://keycloak.nonrtric:8080/realms/nonrtric-realm/protocol/openid-connect/token
78         - name: OUTPUT_FILE
79           value: /token-cache/jwt.txt
80
81         volumeMounts:
82         - mountPath: /token-cache
83           name: token-cache-volume
84       volumes:
85         - name: pm-producer-json2kafka-cm-data
86           configMap:
87             name: pm-producer-json2kafka-cm-data
88         - name: pm-producer-json2kafka-cm-config
89           configMap:
90             name: pm-producer-json2kafka-cm-config
91         - name: token-cache-volume
92           emptyDir: {}