aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/aks/post-install
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2019-12-05 14:14:32 -0800
committerBrian Freeman <bf1936@att.com>2019-12-09 13:19:36 +0000
commitf3519424a5c99b59e2b508dae510cdac27cc6dc5 (patch)
tree245c1f3fce046cd87751902853e8e45c85bfeb4d /deployment/aks/post-install
parent48a45d1acc24778b9ba2620714815b6a0c034379 (diff)
[INT] various updates to AKS deployment scripts
- Adding support for pluggable post-install scripts. See README. - Adding pre_install check to validate the correct software is installed before attempting deployment. - Updating AKS deploy command line to support azure cli 2.0.75. Issue-ID: INT-1398 Signed-off-by: stark, steven <steven.stark@att.com> Change-Id: I1ff819e96a3f34c88580e90e8d6f2b79979a7a61
Diffstat (limited to 'deployment/aks/post-install')
-rwxr-xr-xdeployment/aks/post-install/000_bootstrap_onap.sh91
-rwxr-xr-xdeployment/aks/post-install/bootstrap/bootstrap.sh (renamed from deployment/aks/post-install/bootstrap.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_az.sh (renamed from deployment/aks/post-install/create_az.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_clli.sh (renamed from deployment/aks/post-install/create_clli.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_cloud_region.sh (renamed from deployment/aks/post-install/create_cloud_region.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_cloud_region_relationship.sh (renamed from deployment/aks/post-install/create_cloud_region_relationship.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_cloud_region_subscriber_relationship.sh (renamed from deployment/aks/post-install/create_cloud_region_subscriber_relationship.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_cloud_site.sh (renamed from deployment/aks/post-install/create_cloud_site.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_customer.sh (renamed from deployment/aks/post-install/create_customer.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_lob.sh (renamed from deployment/aks/post-install/create_lob.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_owning_entity.sh (renamed from deployment/aks/post-install/create_owning_entity.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_platform.sh (renamed from deployment/aks/post-install/create_platform.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_project.sh (renamed from deployment/aks/post-install/create_project.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_service_type.sh (renamed from deployment/aks/post-install/create_service_type.sh)0
-rwxr-xr-xdeployment/aks/post-install/bootstrap/create_subscription.sh (renamed from deployment/aks/post-install/create_subscription.sh)0
15 files changed, 91 insertions, 0 deletions
diff --git a/deployment/aks/post-install/000_bootstrap_onap.sh b/deployment/aks/post-install/000_bootstrap_onap.sh
new file mode 100755
index 000000000..9904a54d2
--- /dev/null
+++ b/deployment/aks/post-install/000_bootstrap_onap.sh
@@ -0,0 +1,91 @@
+#!/bin/bash
+# Copyright 2019 AT&T Intellectual Property. All rights reserved.
+#
+# 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.
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+CONF=$1
+
+if [ -z "$CONF" ]; then
+ echo "Configuration file required, exiting..."
+ exit 1
+fi
+
+. $CONF
+
+kubectl create configmap onap-bootstrap --from-file=$DIR/bootstrap/ --from-file=kubeconfig=$KUBECONFIG --from-file=onap.conf=$CONF
+
+cat <<EOF | kubectl apply -f -
+apiVersion: v1
+kind: Pod
+metadata:
+ name: onap-bootstrap
+spec:
+ containers:
+ - name: onap-bootstrap
+ image: alpine
+ env:
+ - name: BUILD_DIR
+ value: "/tmp/onap-bootstrap-files"
+ volumeMounts:
+ - name: onap-bootstrap
+ mountPath: /onap-bootstrap
+ command: ["/bin/sh"]
+ args:
+ - -c
+ - apk update && \
+ apk add bash && \
+ apk add git && \
+ apk add jq && \
+ apk add curl && \
+ apk add openjdk8 && \
+ apk add openjdk8-jre && \
+ export PATH=$PATH:/usr/lib/jvm/java-1.8-openjdk/bin && \
+ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \
+ chmod +x ./kubectl && \
+ mv ./kubectl /usr/local/bin/kubectl && \
+ cd /onap-bootstrap && \
+ . onap.conf && \
+ export KUBECONFIG=kubeconfig && \
+ sh -c "/onap-bootstrap/bootstrap.sh"
+ restartPolicy: Never
+ volumes:
+ - name: onap-bootstrap
+ configMap:
+ name: onap-bootstrap
+ defaultMode: 0777
+EOF
+
+echo "Creating pod to Bootstrap ONAP with OpenStack details."
+echo "This might take a while if OpenStack is still launching..."
+
+podstatus=""
+COUNTER=0
+
+while [ "$podstatus" != "Error" ] && [ "$podstatus" != "Completed" ] && [ $COUNTER -lt 60 ]; do
+ podstatus=`kubectl get pods | grep onap-bootstrap | head -1 | awk '{print $3}'`
+ echo "onap-bootstrap is $podstatus"
+ COUNTER=$((COUNTER +1))
+ sleep 30
+done
+
+echo "onap-bootstrap pod logs available at /tmp/onap-bootstrap-log"
+kubectl logs onap-bootstrap > /tmp/onap-bootstrap-log
+
+kubectl delete pod onap-bootstrap
+kubectl delete configmap onap-bootstrap
+
+if [ "$podstatus" = "Error" ]; then
+ echo "ONAP bootstrap failed!"
+fi
diff --git a/deployment/aks/post-install/bootstrap.sh b/deployment/aks/post-install/bootstrap/bootstrap.sh
index 646a502e2..646a502e2 100755
--- a/deployment/aks/post-install/bootstrap.sh
+++ b/deployment/aks/post-install/bootstrap/bootstrap.sh
diff --git a/deployment/aks/post-install/create_az.sh b/deployment/aks/post-install/bootstrap/create_az.sh
index 1e0407c12..1e0407c12 100755
--- a/deployment/aks/post-install/create_az.sh
+++ b/deployment/aks/post-install/bootstrap/create_az.sh
diff --git a/deployment/aks/post-install/create_clli.sh b/deployment/aks/post-install/bootstrap/create_clli.sh
index dec8b8b06..dec8b8b06 100755
--- a/deployment/aks/post-install/create_clli.sh
+++ b/deployment/aks/post-install/bootstrap/create_clli.sh
diff --git a/deployment/aks/post-install/create_cloud_region.sh b/deployment/aks/post-install/bootstrap/create_cloud_region.sh
index dd83cb387..dd83cb387 100755
--- a/deployment/aks/post-install/create_cloud_region.sh
+++ b/deployment/aks/post-install/bootstrap/create_cloud_region.sh
diff --git a/deployment/aks/post-install/create_cloud_region_relationship.sh b/deployment/aks/post-install/bootstrap/create_cloud_region_relationship.sh
index 7acdea9d2..7acdea9d2 100755
--- a/deployment/aks/post-install/create_cloud_region_relationship.sh
+++ b/deployment/aks/post-install/bootstrap/create_cloud_region_relationship.sh
diff --git a/deployment/aks/post-install/create_cloud_region_subscriber_relationship.sh b/deployment/aks/post-install/bootstrap/create_cloud_region_subscriber_relationship.sh
index d37b5653f..d37b5653f 100755
--- a/deployment/aks/post-install/create_cloud_region_subscriber_relationship.sh
+++ b/deployment/aks/post-install/bootstrap/create_cloud_region_subscriber_relationship.sh
diff --git a/deployment/aks/post-install/create_cloud_site.sh b/deployment/aks/post-install/bootstrap/create_cloud_site.sh
index 0253b0e16..0253b0e16 100755
--- a/deployment/aks/post-install/create_cloud_site.sh
+++ b/deployment/aks/post-install/bootstrap/create_cloud_site.sh
diff --git a/deployment/aks/post-install/create_customer.sh b/deployment/aks/post-install/bootstrap/create_customer.sh
index 0beebe97a..0beebe97a 100755
--- a/deployment/aks/post-install/create_customer.sh
+++ b/deployment/aks/post-install/bootstrap/create_customer.sh
diff --git a/deployment/aks/post-install/create_lob.sh b/deployment/aks/post-install/bootstrap/create_lob.sh
index a14367ddf..a14367ddf 100755
--- a/deployment/aks/post-install/create_lob.sh
+++ b/deployment/aks/post-install/bootstrap/create_lob.sh
diff --git a/deployment/aks/post-install/create_owning_entity.sh b/deployment/aks/post-install/bootstrap/create_owning_entity.sh
index eba395591..eba395591 100755
--- a/deployment/aks/post-install/create_owning_entity.sh
+++ b/deployment/aks/post-install/bootstrap/create_owning_entity.sh
diff --git a/deployment/aks/post-install/create_platform.sh b/deployment/aks/post-install/bootstrap/create_platform.sh
index 46dc1b4e6..46dc1b4e6 100755
--- a/deployment/aks/post-install/create_platform.sh
+++ b/deployment/aks/post-install/bootstrap/create_platform.sh
diff --git a/deployment/aks/post-install/create_project.sh b/deployment/aks/post-install/bootstrap/create_project.sh
index 7b455e3b0..7b455e3b0 100755
--- a/deployment/aks/post-install/create_project.sh
+++ b/deployment/aks/post-install/bootstrap/create_project.sh
diff --git a/deployment/aks/post-install/create_service_type.sh b/deployment/aks/post-install/bootstrap/create_service_type.sh
index c712c53f6..c712c53f6 100755
--- a/deployment/aks/post-install/create_service_type.sh
+++ b/deployment/aks/post-install/bootstrap/create_service_type.sh
diff --git a/deployment/aks/post-install/create_subscription.sh b/deployment/aks/post-install/bootstrap/create_subscription.sh
index 4bb2e6412..4bb2e6412 100755
--- a/deployment/aks/post-install/create_subscription.sh
+++ b/deployment/aks/post-install/bootstrap/create_subscription.sh