[INT] updating aks install w/ master pass
- Also updating openstack cli to py3 to fix import issues
Issue-ID: INT-1557
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: I99cbc68614e0fcc8fd0572fd7c44c7cd431b215b
diff --git a/deployment/aks/cloud.conf b/deployment/aks/cloud.conf
index d37da0e..6223670 100644
--- a/deployment/aks/cloud.conf
+++ b/deployment/aks/cloud.conf
@@ -84,3 +84,5 @@
CHART_VERSION=
OOM_OVERRIDES=
DOCKER_REPOSITORY=
+MASTER_PASSWORD=
+
diff --git a/deployment/aks/cloud.conf.example b/deployment/aks/cloud.conf.example
index 3172be1..71bc7bf 100644
--- a/deployment/aks/cloud.conf.example
+++ b/deployment/aks/cloud.conf.example
@@ -84,3 +84,4 @@
CHART_VERSION="5.0.0"
OOM_OVERRIDES=""
DOCKER_REPOSITORY="nexus3.onap.org:10001"
+MASTER_PASSWORD=test123
diff --git a/deployment/aks/cloud.sh b/deployment/aks/cloud.sh
index b998651..a1cbfe8 100755
--- a/deployment/aks/cloud.sh
+++ b/deployment/aks/cloud.sh
@@ -159,6 +159,7 @@
CHART_VERSION = "$CHART_VERSION"
OOM_OVERRIDES = "$OOM_OVERRIDES"
DOCKER_REPOSITORY = "$DOCKER_REPOSITORY"
+MASTER_PASSWORD = "$MASTER_PASSWORD"
EOF
@@ -347,7 +348,8 @@
"$DOCKER_REPOSITORY" \
"$NFS_PRIVATE_IP" \
"$AKS_PUBLIC_IP_ADDRESS" \
- "$BUILD_DIR/kubeconfig"
+ "$BUILD_DIR/kubeconfig" \
+ "$MASTER_PASSWORD"
fi
@@ -361,7 +363,8 @@
"$OOM_BRANCH" \
"$BUILD_DIR" \
"$CHART_VERSION" \
- "$OOM_OVERRIDES"
+ "$OOM_OVERRIDES" \
+ "$MASTER_PASSWORD"
fi
diff --git a/deployment/aks/create_onap.sh b/deployment/aks/create_onap.sh
index 9a494df..9588744 100755
--- a/deployment/aks/create_onap.sh
+++ b/deployment/aks/create_onap.sh
@@ -21,6 +21,7 @@
BUILD_DIR=$4
CHART_VERSION=$5
OOM_OVERRIDES=$6
+MASTER_PASSWORD=$7
pushd .
@@ -73,13 +74,13 @@
cp -R helm/plugins/ ~/.helm
-make all
+make all -e SKIP_LINT=TRUE
if [ $? -ne 0 ]; then
echo "Failed building helm charts, exiting..."
exit 1
fi
-make onap
+make onap -e SKIP_LINT=TRUE
if [ $? -ne 0 ]; then
echo "Failed building helm charts, exiting..."
exit 1
@@ -92,7 +93,7 @@
helm repo remove stable
build_name=`echo "$BUILD_NAME" | tr '[:upper:]' '[:lower:]'`
-helm deploy "$build_name" local/onap --version v"$CHART_VERSION" "$OOM_OVERRIDES" --namespace onap "$TEMPLATE_OVERRIDES"
+helm deploy "$build_name" local/onap --version v"$CHART_VERSION" --set "global.masterPassword=$MASTER_PASSWORD" "$OOM_OVERRIDES" --namespace onap "$TEMPLATE_OVERRIDES"
kubectl get pods --namespace onap
diff --git a/deployment/aks/post-install/bootstrap/create_cloud_site.sh b/deployment/aks/post-install/bootstrap/create_cloud_site.sh
index 0253b0e..daa4dc2 100755
--- a/deployment/aks/post-install/bootstrap/create_cloud_site.sh
+++ b/deployment/aks/post-install/bootstrap/create_cloud_site.sh
@@ -31,7 +31,7 @@
echo $SO_ENCRYPTED_KEY
-MARIADBPOD_STATUS=`kubectl -n onap get pods | grep mariadb-galera-mariadb-galera | head -1 | awk '{print $3}'`
+MARIADBPOD_STATUS=`kubectl -n onap get pods | grep mariadb-galera | head -1 | awk '{print $3}'`
COUNTER=0
until [ "$MARIADBPOD_STATUS" = "Running" ] || [ $COUNTER -gt 120 ]; do
@@ -40,11 +40,13 @@
sleep 10
done
-MARIADBPOD=`kubectl -n onap get pods | grep mariadb-galera-mariadb-galera | head -1 | awk '{print $1}'`
+MARIADBPOD=`kubectl -n onap get pods | grep mariadb-galera | head -1 | awk '{print $1}'`
+MARIADBSECRET=`kubectl -n onap get secrets | grep mariadb-galera-db-root-password | head -1 | awk '{print $1}'`
+MARIADBPASSWORD=`kubectl -n onap get secret $MARIADBSECRET -o jsonpath="{.data.password}" | base64 -d`
COMMAND="INSERT INTO identity_services (id, identity_url, mso_id, mso_pass, admin_tenant, member_role, tenant_metadata, identity_server_type, identity_authentication_type, project_domain_name, user_domain_name) VALUES (\"$OS_ID\", \"http://$OPENSTACK_IP/identity/v3\", \"$OPENSTACK_USER\", \"$SO_ENCRYPTED_KEY\", \"$OPENSTACK_TENANT\", \"$OS_TENANT_ROLE\", 0, \"$OS_KEYSTONE\", \"USERNAME_PASSWORD\", \"default\", \"default\");"
-kubectl -n onap exec -it $MARIADBPOD -- bash -c "mysql -u root --password=secretpassword --database=catalogdb --execute='$COMMAND'"
+kubectl -n onap exec -it $MARIADBPOD -- bash -c "mysql -u root --password='$MARIADBPASSWORD' --database=catalogdb --execute='$COMMAND'"
COMMAND="INSERT INTO cloud_sites (id, region_id, identity_service_id, cloud_version, clli) VALUES (\"$CLOUD_REGION\", \"$OPENSTACK_REGION\", \"$OS_ID\", \"2.5\", \"$CLOUD_REGION\");"
-kubectl -n onap exec -it $MARIADBPOD -- bash -c "mysql -u root --password=secretpassword --database=catalogdb --execute='$COMMAND'"
+kubectl -n onap exec -it $MARIADBPOD -- bash -c "mysql -u root --password='$MARIADBPASSWORD' --database=catalogdb --execute='$COMMAND'"
diff --git a/deployment/aks/util/create_integration_override.sh b/deployment/aks/util/create_integration_override.sh
index 15d8539..88c6f9f 100755
--- a/deployment/aks/util/create_integration_override.sh
+++ b/deployment/aks/util/create_integration_override.sh
@@ -22,6 +22,7 @@
NFS_IP_ADDR=$5
K8S_01_VM_IP=$6
KUBECONFIG=$7
+MASTER_PASSWORD=$8
. $OPENSTACK_RC
@@ -72,4 +73,4 @@
echo "export OS_PROJECT_ID=$OS_PROJECT_ID" >> "$OPENSTACK_RC"
-$DIR/create_robot_config.sh "$OPENSTACK_RC" "$BUILD_DIR/openstack_params.conf" "$BUILD_DIR" "$DIR/integration_override.template"
+$DIR/create_robot_config.sh "$OPENSTACK_RC" "$BUILD_DIR/openstack_params.conf" "$BUILD_DIR" "$DIR/integration_override.template" "$MASTER_PASSWORD"
diff --git a/deployment/aks/util/create_openstack_cli.sh b/deployment/aks/util/create_openstack_cli.sh
index 01ae886..8f3f331 100755
--- a/deployment/aks/util/create_openstack_cli.sh
+++ b/deployment/aks/util/create_openstack_cli.sh
@@ -39,14 +39,14 @@
args:
- -c
- apk update && \
- apk add python && \
- apk add py-pip && \
- apk add python-dev && \
+ apk add python3 && \
+ apk add py3-pip && \
+ apk add python3-dev && \
apk add gcc && \
apk add musl-dev && \
apk add libffi-dev && \
apk add openssl-dev && \
- pip install python-openstackclient && \
+ pip3 install python-openstackclient && \
sh -c 'echo ". /openstack/openstack_rc" >> /root/.profile; while true; do sleep 60; done;'
restartPolicy: Never
volumes:
diff --git a/deployment/aks/util/create_robot_config.sh b/deployment/aks/util/create_robot_config.sh
index dea67b8..9c1e15e 100755
--- a/deployment/aks/util/create_robot_config.sh
+++ b/deployment/aks/util/create_robot_config.sh
@@ -17,6 +17,7 @@
OPENSTACK_PARAM=$2
BUILD_DIR=$3
INTEGRATION_TEMPLATE=$4
+MASTER_PASSWORD=$5
if [ "$OPENSTACK_RC" == "" ]
then
@@ -71,6 +72,8 @@
sed -ir -e "s/\${OS_UBUNTU_14_IMAGE}/$OS_UBUNTU_14_IMAGE/" $template
sed -ir -e "s/\${OS_UBUNTU_16_IMAGE}/$OS_UBUNTU_16_IMAGE/" $template
+sed -ir -e "s/\${MASTER_PASSWORD}/$MASTER_PASSWORD/" $template
+
sed -ir -e "s/__nfs_ip_addr__/$NFS_IP_ADDR/" $template
sed -ir -e "s/__k8s_01_vm_ip__/$K8S_01_VM_IP/" $template
diff --git a/deployment/aks/util/integration_override.template b/deployment/aks/util/integration_override.template
index 5f24824..108357d 100644
--- a/deployment/aks/util/integration_override.template
+++ b/deployment/aks/util/integration_override.template
@@ -1,6 +1,7 @@
global:
repository: __docker_proxy__
pullPolicy: IfNotPresent
+ masterPassword: "${MASTER_PASSWORD}"
robot:
enabled: true
flavor: large