Rename ssl related files and variable names to make it more clear. 42/9442/2
authordliu5 <david.liu@windriver.com>
Mon, 31 Oct 2022 06:24:04 +0000 (14:24 +0800)
committerdliu5 <david.liu@windriver.com>
Mon, 31 Oct 2022 11:00:36 +0000 (19:00 +0800)
Add SMO certificate variable and mount.

Signed-off-by: dliu5 <david.liu@windriver.com>
Change-Id: Ia65c0a5af41731de99f092004f5e04093cc6767d

charts/resources/scripts/init/o2api_start.sh
charts/templates/deployment.yaml
charts/templates/servercrt.yaml [moved from charts/templates/serverkey_config.yaml with 90% similarity]
charts/templates/serverkey.yaml [new file with mode: 0644]
charts/templates/smocacrt.yaml [moved from charts/templates/ca_config.yaml with 91% similarity]
charts/values.yaml
docs/installation-guide.rst

index 6aa68a4..9b376f4 100644 (file)
@@ -31,6 +31,6 @@ cat <<EOF>>/etc/hosts
 EOF
 
 
-flask run --host=0.0.0.0 --port=80 --cert /configs/ca.cert  --key /configs/server.key
+flask run --host=0.0.0.0 --port=80 --cert /configs/server.crt  --key /configs/server.key
 
 sleep infinity
index 194ca7e..bcc8dc9 100644 (file)
@@ -153,14 +153,18 @@ spec:
               mountPath: /configs/o2app.conf
               subPath: config.json
               readOnly: true
-            - name: caconfig
-              mountPath: /configs/ca.cert
+            - name: servercrt
+              mountPath: /configs/server.crt
               subPath: config.json
               readOnly: true
-            - name: serverkeyconfig
+            - name: serverkey
               mountPath: /configs/server.key
               subPath: config.json
               readOnly: true
+            - name: smocacrt
+              mountPath: /configs/smoca.crt
+              subPath: config.json
+              readOnly: true
         - name: helmcli
           image: "{{ .Values.o2ims.image.repository }}:{{ .Values.o2ims.image.tag }}"
           ports:
@@ -184,10 +188,12 @@ spec:
             name: {{ .Chart.Name }}-application-config
           name: applicationconfig
         - configMap:
-            name: {{ .Chart.Name }}-serverkeyconfig
-          name: serverkeyconfig
+            name: {{ .Chart.Name }}-serverkey
+          name: serverkey
         - configMap:
-            name: {{ .Chart.Name }}-caconfig
-          name: caconfig
+            name: {{ .Chart.Name }}-servercrt
+          name: servercrt
+        - configMap:
+            name: {{ .Chart.Name }}-smocacrt
+          name: smocacrt
 ---
-
similarity index 90%
rename from charts/templates/serverkey_config.yaml
rename to charts/templates/servercrt.yaml
index c8b8882..1e736a8 100644 (file)
@@ -16,7 +16,7 @@
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: {{ .Chart.Name }}-serverkeyconfig
+  name: {{ .Chart.Name }}-servercrt
   namespace: {{ .Values.global.namespace }}
   labels:
     release: {{ .Release.Name }}
@@ -24,4 +24,4 @@ metadata:
     chart: {{ .Chart.Name }}
 # ...
 binaryData:
-  config.json: {{ .Values.serverkeyconfig }}
+  config.json: {{ .Values.servercrt }}
diff --git a/charts/templates/serverkey.yaml b/charts/templates/serverkey.yaml
new file mode 100644 (file)
index 0000000..186195d
--- /dev/null
@@ -0,0 +1,27 @@
+# Copyright (C) 2022 Wind River Systems, Inc.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ .Chart.Name }}-serverkey
+  namespace: {{ .Values.global.namespace }}
+  labels:
+    release: {{ .Release.Name }}
+    app: {{ include "orano2.name" . }}
+    chart: {{ .Chart.Name }}
+# ...
+binaryData:
+  config.json: {{ .Values.serverkey }}
similarity index 91%
rename from charts/templates/ca_config.yaml
rename to charts/templates/smocacrt.yaml
index 41c0457..765109d 100644 (file)
@@ -16,7 +16,7 @@
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: {{ .Chart.Name }}-caconfig
+  name: {{ .Chart.Name }}-smocacrt
   namespace: {{ .Values.global.namespace }}
   labels:
     release: {{ .Release.Name }}
@@ -24,4 +24,4 @@ metadata:
     chart: {{ .Chart.Name }}
 # ...
 binaryData:
-  config.json: {{ .Values.caconfig }}
+  config.json: {{ .Values.smocacrt }}
index 9a743d6..6d1fa54 100644 (file)
@@ -24,9 +24,11 @@ fullnameOverride: ""
 
 applicationconfig: ""
 
-caconfig: ""
+servercrt: ""
 
-serverkeyconfig: ""
+serverkey: ""
+
+smocacrt: ""
 
 resources:
   cpu: 1
index 1e0a465..9854ef6 100644 (file)
@@ -179,7 +179,8 @@ The following instruction should be done outside of INF platform controller host
   kubectl apply -f smo-serviceaccount.yaml
 
   #export the smo account token data
-  export SMO_TOKEN_DATA=$(kubectl -n default describe secret $(kubectl -n default get secret | grep ${SMO_SERVICEACCOUNT} | awk '{print $1}') | grep "token:" | awk '{print $2}')
+  export SMO_SECRET=$(kubectl -n default get serviceaccounts $SMO_SERVICEACCOUNT -o jsonpath='{.secrets[0].name}')
+  export SMO_TOKEN_DATA=$(kubectl -n default get secrets $SMO_SECRET -o jsonpath='{.data.token}')
 
   #prepare the application config file
   cat <<EOF >app.conf
@@ -234,12 +235,14 @@ The following instruction should be done outside of INF platform controller host
 
 
   applicationconfig=`base64 app.conf -w 0`
-  caconfig=`base64 imsserver.crt -w 0`
-  serverkeyconfig=`base64 imsserver.key -w 0`
+  servercrt=`base64 imsserver.crt -w 0`
+  serverkey=`base64 imsserver.key -w 0`
+  smocacrt=`base64 smoca.crt -w 0`
 
   echo $applicationconfig
-  echo $caconfig
-  echo $serverkeyconfig
+  echo $servercrt
+  echo $serverkey
+  echo $smocacrt
 
 
   cat <<EOF>o2service-override.yaml
@@ -258,8 +261,9 @@ The following instruction should be done outside of INF platform controller host
     API_HOST_EXTERNAL_FLOATING: "${API_HOST_EXTERNAL_FLOATING}"
 
   applicationconfig: ${applicationconfig}
-  caconfig: ${caconfig}
-  serverkeyconfig: ${serverkeyconfig}
+  servercrt: ${servercrt}
+  serverkey: ${serverkey}
+  smocacrt: ${smocacrt}
 
   EOF