2d078652aa4153ca067e99d9c13d7aa4f58d6596
[nonrtric/plt/ranpm.git] / install / helm / nrt-pm-log / 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: pmlog
24   namespace: nonrtric
25   labels:
26     app: pmlog
27 spec:
28   replicas: 1
29   serviceName: pmlog
30   selector:
31     matchLabels:
32       app: pmlog
33   template:
34     metadata:
35       labels:
36         app: pmlog
37     spec:
38       volumes:
39         - name: pmlog-app-cm
40           configMap:
41             name: pmlog-app-cm
42         - name: pmlog-job-cm
43           configMap:
44             name: pmlog-job-cm
45         - name: token-cache-volume
46           emptyDir: {}
47       containers:
48       - name: auth-token
49         image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1
50         imagePullPolicy: Always
51         env:
52         - name: CREDS_GRANT_TYPE
53           value: client_credentials
54         - name: CREDS_CLIENT_SECRET
55           value: {{ .Values.nrtpmlog.clientsecret }}
56         - name: CREDS_CLIENT_ID
57           value: nrt-pm-log
58         - name: AUTH_SERVICE_URL
59           value: http://keycloak.nonrtric:8080/realms/nonrtric-realm/protocol/openid-connect/token
60         - name: OUTPUT_FILE
61           value: /token-cache/jwt.txt
62         volumeMounts:
63         - mountPath: /token-cache
64           name: token-cache-volume
65       - name: pmlog
66         image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-plt-pmlog:1.1.0
67         imagePullPolicy: Always
68         command:
69         - sh
70         - -c
71         - until [ -e /token-cache/jwt.txt ]; do echo "Waiting for JWT to be available"; sleep 1; done; /jre/bin/java -jar /opt/app/pmlog-service/pmlog.jar
72         ports:
73         - name: http
74           containerPort: 8084
75         - name: https
76           containerPort: 8436
77         volumeMounts:
78         - name: pmlog-app-cm
79           mountPath: /opt/app/pmlog-service/config/application.yaml
80           subPath: application.yaml
81         - name: pmlog-job-cm
82           mountPath: /opt/app/pmlog-service/config/jobDefinition.json
83           subPath: jobDefinition.json
84         - mountPath: /token-cache
85           name: token-cache-volume
86         env:
87         - name: APP_INFLUX_ACCESSTOKEN
88           valueFrom:
89             secretKeyRef:
90               name: influxdb-api-token
91               key: token
92
93
94
95
96