Skip to content

Commit 42b498a

Browse files
authored
Merge pull request #777 from ananto-msft/may-2020
May 2020 update
2 parents 77f2d25 + 0d43507 commit 42b498a

2 files changed

Lines changed: 57 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ sudo kubeadm reset --force
66

77
# Clean up azdata-cli package.
88
#
9+
azdata extension remove --name azdata-cli-dc --yes
10+
azdata extension remove --name azdata-cli-postgres --yes
11+
azdata extension remove --name azdata-cli-sqlinstance --yes
912
unalias azdata
1013
unalias az
1114
sudo dpkg --remove --force-all azdata-cli

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

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/bash
22

33
# Get controller username and password as input. It is used as default for the controller.
44
#
@@ -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.
@@ -49,7 +81,7 @@ export DEBIAN_FRONTEND=noninteractive
4981

5082
# Requirements file.
5183
export 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 -
123155
azdata --version
124156
echo "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
#
128173
curl -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-
139182
sudo swapoff -a
140183
sudo 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
294343
echo "Azure Arc Data Controller cluster created."
295344

296345
# Setting context to cluster.

0 commit comments

Comments
 (0)