Add SMO certificate variable and mount.
Signed-off-by: dliu5 <david.liu@windriver.com>
Change-Id: Ia65c0a5af41731de99f092004f5e04093cc6767d
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
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:
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
---
-
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ .Chart.Name }}-serverkeyconfig
+ name: {{ .Chart.Name }}-servercrt
namespace: {{ .Values.global.namespace }}
labels:
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}
# ...
binaryData:
- config.json: {{ .Values.serverkeyconfig }}
+ config.json: {{ .Values.servercrt }}
--- /dev/null
+# 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 }}
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ .Chart.Name }}-caconfig
+ name: {{ .Chart.Name }}-smocacrt
namespace: {{ .Values.global.namespace }}
labels:
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}
# ...
binaryData:
- config.json: {{ .Values.caconfig }}
+ config.json: {{ .Values.smocacrt }}
applicationconfig: ""
-caconfig: ""
+servercrt: ""
-serverkeyconfig: ""
+serverkey: ""
+
+smocacrt: ""
resources:
cpu: 1
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
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
API_HOST_EXTERNAL_FLOATING: "${API_HOST_EXTERNAL_FLOATING}"
applicationconfig: ${applicationconfig}
- caconfig: ${caconfig}
- serverkeyconfig: ${serverkeyconfig}
+ servercrt: ${servercrt}
+ serverkey: ${serverkey}
+ smocacrt: ${smocacrt}
EOF