1- #! /bin/bash
1+ #! /bin/bash
22
33# Get controller username and password as input. It is used as default for the controller.
44#
3636 export DOCKER_PASSWORD=$AADC_PASSWORD
3737fi
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+
3971set -Eeuo pipefail
4072
4173# This is a script to create single-node Kubernetes cluster and deploy Azure Arc Data Controller on it.
@@ -49,7 +81,7 @@ export DEBIAN_FRONTEND=noninteractive
4981
5082# Requirements file.
5183export OSCODENAME=$( lsb_release -cs)
52- export AZDATA_PRIVATE_PREVIEW_DEB_PACKAGE=" https://aka.ms/mar- 2020- azdata-" $OSCODENAME
84+ export AZDATA_PRIVATE_PREVIEW_DEB_PACKAGE=" https://private-repo.microsoft.com/python/azure-arc-data/private-preview-may- 2020/ubuntu- " $OSCODENAME " / azdata-cli_15.0.4033-1~ " $OSCODENAME " _all.deb "
5385
5486# Kube version.
5587#
@@ -123,6 +155,19 @@ cd -
123155azdata --version
124156echo " Azdata has been successfully installed."
125157
158+ # Installing azdata extensions
159+ #
160+ echo " Installing azdata extension for Arc data controller..."
161+ azdata extension add --source https://private-repo.microsoft.com/python/azure-arc-data/private-preview-may-2020/pypi-azdata-cli-extensions/azdata_cli_dc-0.0.1-py2.py3-none-any.whl --yes
162+
163+ echo " Installing azdata extension for postgres..."
164+ azdata extension add --source https://private-repo.microsoft.com/python/azure-arc-data/private-preview-may-2020/pypi-azdata-cli-extensions/azdata_cli_postgres-0.0.1-py2.py3-none-any.whl --yes
165+
166+ echo " Installing azdata extension for sql..."
167+ azdata extension add --source https://private-repo.microsoft.com/python/azure-arc-data/private-preview-may-2020/pypi-azdata-cli-extensions/azdata_cli_sqlinstance-0.0.1-py2.py3-none-any.whl --yes
168+
169+ echo " Azdata extensions installed successfully."
170+
126171# Install Azure CLI
127172#
128173curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
@@ -134,8 +179,6 @@ echo "Starting to setup pre-requisites for kubernetes..."
134179
135180# Setup the kubernetes preprequisites.
136181#
137- echo $( hostname -i) $( hostname) >> sudo tee -a /etc/hosts
138-
139182sudo swapoff -a
140183sudo sed -i ' /swap/s/^\(.*\)$/#\1/g' /etc/fstab
141184
@@ -290,7 +333,13 @@ echo "Starting to deploy azdata cluster..."
290333
291334# Command to create cluster for single node cluster.
292335#
293- azdata control create -n $CLUSTER_NAME -c azure-arc-kubeadm-private-preview --accept-eula $ACCEPT_EULA
336+ azdata arc dc config init -s azure-arc-kubeadm-private-preview -t azure-arc-custom --force
337+ azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values ' $.spec.dataController.displayName=$ARC_DC_NAME'
338+ azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values ' $.spec.dataController.subscription=$ARC_DC_SUBSCRIPTION'
339+ azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values ' $.spec.dataController.resourceGroup=$ARC_DC_RG'
340+ azdata arc dc config replace --config-file azure-arc-custom/control.json --json-values ' $.spec.dataController.location=$ARC_DC_REGION'
341+
342+ azdata arc dc create -n $CLUSTER_NAME -c azure-arc-custom --accept-eula $ACCEPT_EULA
294343echo " Azure Arc Data Controller cluster created."
295344
296345# Setting context to cluster.
0 commit comments