565d7637d32eb5553b7b43214cb17dccfd8731aa
[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:10004/o-ran-sc/nonrtric-plt-pmproducer:1.0.0
40         #image: o-ran-sc/nonrtric-plt-pmproducer:1.0.0-SNAPSHOT
41         imagePullPolicy: Always
42         #imagePullPolicy: Never
43         ports:
44         - name: http
45           containerPort: 8084
46         env:
47         - name: APPID
48           valueFrom:
49             fieldRef:
50               fieldPath: metadata.name
51         - name: APPNS
52           valueFrom:
53             fieldRef:
54               fieldPath: metadata.namespace
55         # Overriding value in application.yaml
56         - name: APP_PM-PRODUCER-BASE-URL
57           value: "http://$(APPID).pm-producer-json2kafka.$(APPNS):8084"
58         volumeMounts:
59         - mountPath: /opt/app/pm-producer-service/data/application_configuration.json
60           subPath: application_configuration.json
61           name: pm-producer-json2kafka-cm-data
62         - mountPath: /opt/app/pm-producer-service/config/application.yaml
63           subPath: application.yaml
64           name: pm-producer-json2kafka-cm-config
65         - mountPath: /token-cache
66           name: token-cache-volume
67       - name: auth-token
68         image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1
69         imagePullPolicy: Always
70         env:
71         - name: CREDS_GRANT_TYPE
72           value: client_credentials
73         - name: CREDS_CLIENT_SECRET
74           value: {{ .Values.pmproducerjson2kafka.clientsecret }}
75         - name: CREDS_CLIENT_ID
76           value: pm-producer-json2kafka
77         - name: AUTH_SERVICE_URL
78           value: http://keycloak.nonrtric:8080/realms/nonrtric-realm/protocol/openid-connect/token
79         - name: OUTPUT_FILE
80           value: /token-cache/jwt.txt
81
82         volumeMounts:
83         - mountPath: /token-cache
84           name: token-cache-volume
85       volumes:
86         - name: pm-producer-json2kafka-cm-data
87           configMap:
88             name: pm-producer-json2kafka-cm-data
89         - name: pm-producer-json2kafka-cm-config
90           configMap:
91             name: pm-producer-json2kafka-cm-config
92         - name: token-cache-volume
93           emptyDir: {}