Update installation files 11/10111/2
authorktimoney <kevin.timoney@est.tech>
Tue, 13 Dec 2022 09:23:43 +0000 (09:23 +0000)
committerktimoney <kevin.timoney@est.tech>
Tue, 13 Dec 2022 14:14:22 +0000 (14:14 +0000)
Change-Id: I6c9e91bee7e2767c24b7db2227670f8a5f0f4a08
Issue-ID: NONRTRIC-822
Signed-off-by: ktimoney <kevin.timoney@est.tech>
15 files changed:
service-exposure/Dockerfile_wh [new file with mode: 0644]
service-exposure/README.md
service-exposure/certs/client_certs.sh [changed mode: 0644->0755]
service-exposure/certs/server_certs.sh [changed mode: 0644->0755]
service-exposure/certs/test_cert.sh [changed mode: 0644->0755]
service-exposure/certs/webhook_certs.sh [moved from service-exposure/certs/webhook-certs.sh with 98% similarity, mode: 0755]
service-exposure/deploy_rapp.sh [changed mode: 0644->0755]
service-exposure/keycloak.sh [changed mode: 0644->0755]
service-exposure/keycloak.yaml
service-exposure/postgres.yaml
service-exposure/rapps-helm-installer.go
service-exposure/rp_test.sh [changed mode: 0644->0755]
service-exposure/start_pods.sh [changed mode: 0644->0755]
service-exposure/stop_pods.sh [changed mode: 0644->0755]
service-exposure/undeploy_rapp.sh [changed mode: 0644->0755]

diff --git a/service-exposure/Dockerfile_wh b/service-exposure/Dockerfile_wh
new file mode 100644 (file)
index 0000000..1ff9fac
--- /dev/null
@@ -0,0 +1,25 @@
+#
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2022 Nordix Foundation.
+# ================================================================================
+# 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+#
+FROM golang:latest
+RUN mkdir /app
+COPY ./rapps-webhook /app
+RUN chmod +x /app/rapps-webhook
+WORKDIR /app
+ENTRYPOINT ["/app/rapps-webhook"]
index 59069e0..42e4a0a 100644 (file)
@@ -18,7 +18,7 @@
 # ============LICENSE_END=========================================================
 #
 This collection of files represent rapp service exposure prototyping in O-RAN.
-Prerequisites: Istio should be installed on your cluster with the demo profile.
+Prerequisites: Istio should be installed on your cluster with the demo profile. You may need to add istioctl to you $PATH variable.
   istioctl install --set profile=demo
 Please refer to the istio documentation for more information.
 You will also need cfssl installed on your system: sudo apt install golang-cfssl
@@ -36,10 +36,10 @@ rapps-keycloak-mgr.yaml:      path: /var/rapps/certs
 
 or change them to match your own setup.
 
-The certs directory contains 3 shell scripts for creating the server, client and webhook certs: server_certs.sh, client_certs.sh and webhook-certs.sh
+The certs directory contains 3 shell scripts for creating the server, client and webhook certs: server_certs.sh, client_certs.sh and webhook_certs.sh
 Certs generated by the server_certs.sh script: rootCA.crt, tls.crt and tls.key go in the "/var/keycloak/certs" directory
-Certs generated by the client_certs.sh script: client.crt, client.key, client_pub.key and rootCA.crt go in the "/var/rapps/certs" directory
-The webhook-certs.sh script generates certs for use in the MutatingWebhookConfiguration.yaml and the rapps-webhook.yaml files.
+Certs generated by the client_certs.sh script: client.crt, client.key and rootCA.crt go in the "/var/rapps/certs" directory
+The webhook_certs.sh script generates certs for use in the MutatingWebhookConfiguration.yaml and the rapps-webhook.yaml files.
 To configure MutatingWebhookConfiguration.yaml run the following commands:
 1. ca_pem_b64="$(openssl base64 -A <"./certs/ca.pem")"
 2. sed -i 's/${CA_PEM_B64}/'"$ca_pem_b64"'/g' MutatingWebhookConfiguration.yaml
old mode 100644 (file)
new mode 100755 (executable)
index 279258d..fbda1ec
@@ -20,7 +20,7 @@
 #
 
 
-CLIENT_SUBJECT="/C=IE/ST=/L=/O=/OU=Keycloak/CN=localhost/emailAddress=client@mail.com"
+CLIENT_SUBJECT="/C=IE/ST=Dublin/L=Dublin/O=Keycloak/OU=Keycloak/CN=localhost/emailAddress=client@mail.com"
 PW=changeit
 
 echo $PW > secretfile.txt
old mode 100644 (file)
new mode 100755 (executable)
index c399033..a606368
@@ -20,8 +20,8 @@
 #
 
 
-CA_SUBJECT="/C=IE/ST=/L=/O=/OU=Keycloak/CN=localhost/emailAddress=ca@mail.com"
-SERVER_SUBJECT="/C=IE/ST=/L=/O=/OU=Keycloak/CN=localhost/emailAddress=server@mail.com"
+CA_SUBJECT="/C=IE/ST=Dublin/L=Dublin/O=Keycloak/OU=Keycloak/CN=localhost/emailAddress=ca@mail.com"
+SERVER_SUBJECT="/C=IE/ST=Dublin/L=Dublin/O=Keycloak/OU=Keycloak/CN=localhost/emailAddress=server@mail.com"
 PW=changeit
 
 echo $PW > secretfile.txt
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
similarity index 98%
rename from service-exposure/certs/webhook-certs.sh
rename to service-exposure/certs/webhook_certs.sh
index 2a108af..dc38bef
@@ -35,6 +35,7 @@ apiVersion: v1
 kind: Secret
 metadata:
   name: webhook-cert
+  namespace: default
 type: Opaque
 data:
   tls.crt: $(cat webhook-cert.pem | base64 | tr -d '\n')
old mode 100644 (file)
new mode 100755 (executable)
index 4d77350..4d04f6f
@@ -18,7 +18,7 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 #
-export host=$(minikube ip)
+export host=$(kubectl get nodes -o wide | tail -1 | sed s'/  */ /'g | cut -f6 -d' ')
 
 if [ -z "$1" ]
   then
old mode 100644 (file)
new mode 100755 (executable)
index c8c4a63..2beace2 100644 (file)
@@ -27,6 +27,7 @@ apiVersion: v1
 kind: Service
 metadata:
   name: keycloak
+  namespace: default
   labels:
     app: keycloak
 spec:
@@ -123,6 +124,7 @@ apiVersion: networking.istio.io/v1alpha3
 kind: Gateway
 metadata:
   name: kcgateway
+  namespace: default
 spec:
   selector:
     istio: ingressgateway # use istio default ingress gateway
@@ -146,6 +148,7 @@ apiVersion: networking.istio.io/v1alpha3
 kind: VirtualService
 metadata:
   name: keycloak-tls-vs
+  namespace: default
 spec:
   hosts:
   - keycloak.oran.org
@@ -166,6 +169,7 @@ apiVersion: networking.istio.io/v1beta1
 kind: VirtualService
 metadata:
   name: keycloak-vs
+  namespace: default
 spec:
   hosts:
   - "*"
index d0e71c5..4bd1333 100644 (file)
@@ -53,6 +53,7 @@ apiVersion: v1
 kind: ConfigMap
 metadata:
   name: db-init
+  namespace: default
 data:
   init.sql: |
     SELECT 'CREATE DATABASE capif'
index 0dc9341..9dec9f7 100644 (file)
@@ -290,6 +290,7 @@ func main() {
 
 func addToRepo(url string) (string, error) {
        repoFile := settings.RepositoryConfig
+       fmt.Printf("Repo File %s\n", repoFile)
 
        //Ensure the file directory exists as it is required for file locking
        err := os.MkdirAll(filepath.Dir(repoFile), os.ModePerm)
@@ -341,7 +342,10 @@ func dryRun() (*action.Install, error) {
 
        install := action.NewInstall(actionConfig)
 
+       fmt.Printf("Repo Name: %s\n",repoName)
+       fmt.Printf("Chart Name: %s\n",chartName)
        cp, err := install.ChartPathOptions.LocateChart(fmt.Sprintf("%s/%s", repoName, chartName), settings)
+       fmt.Printf("Chart location: %s\n",cp)
 
        chartRequested, err = loader.Load(cp)
 
@@ -537,7 +541,7 @@ func registrerRapp(chartName, chartType string) {
        id serial PRIMARY KEY,
        name VARCHAR ( 50 ) UNIQUE NOT NULL,
        type VARCHAR ( 50 ) NOT NULL,
-       created_on TIMESTAMP DEFAULT NOW()
+       created_on TIMESTAMP DEFAULT NOW() 
         );`
        _, err = db.Exec(createStmt)
        if err != nil {
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index f1dc515..391784e
@@ -18,7 +18,6 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 #
-export host=$(minikube ip)
 
 echo "Deploying applications..."
 echo "-------------------------"
old mode 100644 (file)
new mode 100755 (executable)
index fa67b13..1bc83f6
@@ -19,7 +19,7 @@
 # ============LICENSE_END=========================================================
 #
 
-export host=$(minikube ip)
+export host=$(kubectl get nodes -o wide | tail -1 | sed s'/  */ /'g | cut -f6 -d' ')
 
 echo "Undeploying applications..."
 echo "---------------------------"
old mode 100644 (file)
new mode 100755 (executable)
index 5e37e17..4a75d34
@@ -18,7 +18,7 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 #
-export host=$(minikube ip)
+export host=$(kubectl get nodes -o wide | tail -1 | sed s'/  */ /'g | cut -f6 -d' ')
 
 if [ -z "$1" ]
   then