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