|
36 | 36 | export DOCKER_PASSWORD=$AADC_PASSWORD |
37 | 37 | fi |
38 | 38 |
|
| 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 | + |
39 | 71 | set -Eeuo pipefail |
40 | 72 |
|
41 | 73 | # 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..." |
303 | 335 |
|
304 | 336 | # Command to create cluster for single node cluster. |
305 | 337 | # |
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 |
307 | 345 | echo "Azure Arc Data Controller cluster created." |
308 | 346 |
|
309 | 347 | # Setting context to cluster. |
|
0 commit comments