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