Added wait for auth-token 69/11569/1
authorktimoney <kevin.timoney@est.tech>
Wed, 9 Aug 2023 15:05:31 +0000 (16:05 +0100)
committerJohn Keeney <john.keeney@est.tech>
Wed, 9 Aug 2023 16:49:58 +0000 (16:49 +0000)
Issue-ID: NONRTRIC-906
Change-Id: I18d2967e525f87867c4919c4099325ace011d9cf
Signed-off-by: ktimoney <kevin.timoney@est.tech>
install/helm/nrt-pm-log/templates/app-statefulset.yaml

index cdfa8db..bb033ee 100644 (file)
@@ -44,10 +44,30 @@ spec:
         - name: token-cache-volume
           emptyDir: {}
       containers:
+      - name: auth-token
+        image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1
+        imagePullPolicy: Always
+        env:
+        - name: CREDS_GRANT_TYPE
+          value: client_credentials
+        - name: CREDS_CLIENT_SECRET
+          value: {{ .Values.nrtpmlog.clientsecret }}
+        - name: CREDS_CLIENT_ID
+          value: nrt-pm-log
+        - name: AUTH_SERVICE_URL
+          value: http://keycloak.nonrtric:8080/realms/nonrtric-realm/protocol/openid-connect/token
+        - name: OUTPUT_FILE
+          value: /token-cache/jwt.txt
+        volumeMounts:
+        - mountPath: /token-cache
+          name: token-cache-volume
       - name: pmlog
-#       image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-plt-pmlog:1.0.0
-        image: nexus3.o-ran-sc.org:10003/o-ran-sc/nonrtric-plt-pmlog:1.0.0-SNAPSHOT
+        image: nexus3.o-ran-sc.org:10001/o-ran-sc/nonrtric-plt-pmlog:1.0.0
         imagePullPolicy: Always
+        command:
+        - sh
+        - -c
+        - 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
         ports:
         - name: http
           containerPort: 8084
@@ -68,23 +88,6 @@ spec:
             secretKeyRef:
               name: influxdb-api-token
               key: token
-      - name: auth-token
-        image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-plt-auth-token-fetch:1.1.1
-        imagePullPolicy: Always
-        env:
-        - name: CREDS_GRANT_TYPE
-          value: client_credentials
-        - name: CREDS_CLIENT_SECRET
-          value: {{ .Values.nrtpmlog.clientsecret }}
-        - name: CREDS_CLIENT_ID
-          value: nrt-pm-log
-        - name: AUTH_SERVICE_URL
-          value: http://keycloak.nonrtric:8080/realms/nonrtric-realm/protocol/openid-connect/token
-        - name: OUTPUT_FILE
-          value: /token-cache/jwt.txt
-        volumeMounts:
-        - mountPath: /token-cache
-          name: token-cache-volume