added prompt for DC properties

This commit is contained in:
Bill Liang
2020-05-26 16:40:19 -07:00
parent 0a4f18b34f
commit 91e4b0b2f2
@@ -36,6 +36,38 @@ then
export DOCKER_PASSWORD=$AADC_PASSWORD
fi
# Propmpt for Arc Data Controller properties.
#
if [ -z "$ARC_DC_NAME" ]
then
read -p "Enter a name for the new Azure Arc Data Controller: " dc_name
echo
export ARC_DC_NAME=$dc_name
fi
if [ -z "$ARC_DC_SUBSCRIPTION" ]
then
read -p "Enter a subscription ID for the new Azure Arc Data Controller: " dc_subscription
echo
export ARC_DC_SUBSCRIPTION=$dc_subscription
fi
if [ -z "$ARC_DC_RG" ]
then
read -p "Enter a resource group for the new Azure Arc Data Controller: " dc_rg
echo
export ARC_DC_RG=$dc_rg
fi
if [ -z "$ARC_DC_REGION" ]
then
read -p "Enter a region for the new Azure Arc Data Controller (eastus or eastus2): " dc_region
echo
export ARC_DC_REGION=$dc_region
fi
set -Eeuo pipefail
# This is a script to create single-node Kubernetes cluster and deploy Azure Arc Data Controller on it.
@@ -303,7 +335,13 @@ echo "Starting to deploy azdata cluster..."
# Command to create cluster for single node cluster.
#
azdata arc dc create -n $CLUSTER_NAME -c azure-arc-kubeadm-private-preview --accept-eula $ACCEPT_EULA
azdata arc dc config init -s azure-arc-kubeadm-private-preview -t azure-arc-custom --force
azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values '$.spec.dataController.displayName=$ARC_DC_NAME'
azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values '$.spec.dataController.subscription=$ARC_DC_SUBSCRIPTION'
azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values '$.spec.dataController.resourceGroup=$ARC_DC_RG'
azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values '$.spec.dataController.location=$ARC_DC_REGION'
azdata arc dc create -n $CLUSTER_NAME -c azure-arc-custom --accept-eula $ACCEPT_EULA
echo "Azure Arc Data Controller cluster created."
# Setting context to cluster.