Skip to content

Commit 91e4b0b

Browse files
author
Bill Liang
committed
added prompt for DC properties
1 parent 0a4f18b commit 91e4b0b

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

samples/features/azure-arc/deployment/kubeadm/ubuntu-single-node-vm/setup-controller.sh

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,38 @@ then
3636
export DOCKER_PASSWORD=$AADC_PASSWORD
3737
fi
3838

39+
40+
# Propmpt for Arc Data Controller properties.
41+
#
42+
if [ -z "$ARC_DC_NAME" ]
43+
then
44+
read -p "Enter a name for the new Azure Arc Data Controller: " dc_name
45+
echo
46+
export ARC_DC_NAME=$dc_name
47+
fi
48+
49+
if [ -z "$ARC_DC_SUBSCRIPTION" ]
50+
then
51+
read -p "Enter a subscription ID for the new Azure Arc Data Controller: " dc_subscription
52+
echo
53+
export ARC_DC_SUBSCRIPTION=$dc_subscription
54+
fi
55+
56+
if [ -z "$ARC_DC_RG" ]
57+
then
58+
read -p "Enter a resource group for the new Azure Arc Data Controller: " dc_rg
59+
echo
60+
export ARC_DC_RG=$dc_rg
61+
fi
62+
63+
if [ -z "$ARC_DC_REGION" ]
64+
then
65+
read -p "Enter a region for the new Azure Arc Data Controller (eastus or eastus2): " dc_region
66+
echo
67+
export ARC_DC_REGION=$dc_region
68+
fi
69+
70+
3971
set -Eeuo pipefail
4072

4173
# 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..."
303335

304336
# Command to create cluster for single node cluster.
305337
#
306-
azdata arc dc create -n $CLUSTER_NAME -c azure-arc-kubeadm-private-preview --accept-eula $ACCEPT_EULA
338+
azdata arc dc config init -s azure-arc-kubeadm-private-preview -t azure-arc-custom --force
339+
azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values '$.spec.dataController.displayName=$ARC_DC_NAME'
340+
azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values '$.spec.dataController.subscription=$ARC_DC_SUBSCRIPTION'
341+
azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values '$.spec.dataController.resourceGroup=$ARC_DC_RG'
342+
azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values '$.spec.dataController.location=$ARC_DC_REGION'
343+
344+
azdata arc dc create -n $CLUSTER_NAME -c azure-arc-custom --accept-eula $ACCEPT_EULA
307345
echo "Azure Arc Data Controller cluster created."
308346

309347
# Setting context to cluster.

0 commit comments

Comments
 (0)