Skip to content

Commit e052361

Browse files
authored
Merge pull request #1 from dtzar/acs-quickstart
Update flow and add CLI deployment
2 parents f7c6d68 + 741a218 commit e052361

1 file changed

Lines changed: 49 additions & 8 deletions

File tree

  • src/quickstart/provider/azure-acs

src/quickstart/provider/azure-acs/boot.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Booting Azure Container Service
22

3-
If you do not already have a Azure Cloud account, you can start a trial with $200 of free credit [here](https://azure.microsoft.com/en-us/free/). After completing sign up, you must add your billing information.
3+
## Prerequisites
44

5-
## Install and configure the Azure CLI
5+
1. Azure Accout - If you do not already have a Azure Cloud account, you can start a trial with $200 of free credit [here](https://azure.microsoft.com/en-us/free/). After completing sign up, you must add your billing information.
6+
2. Some form of *nix-based terminal - MacOS, Ubuntu, CentOS, Bash on Windows, etc
7+
<br>Where the following is present:
8+
3. Azure CLI - The Azure CLI (2.0) provides the `az` command and allows you to interact with Azure through the command line. Install the CLI by following the instructions on [GitHub for the Azure CLI](https://github.com/Azure/azure-cli).
9+
4. SSH Key - This is used to deploy the cluster.
10+
5. jq - to parse the JSON responses from the CLI. [jq download page](https://stedolan.github.io/jq/)
611

7-
The Azure CLI (2.0) provides the `az` command and allows you to interact with Azure through the command line. Install the CLI by following the instructions on [GitHub for the Azure CLI](https://github.com/Azure/azure-cli).
12+
## Configure the Azure CLI
813

9-
After installing the CLI, log in to your Azure Account:
14+
After installing the CLI, log in to your Azure Account by typing `az login` and output would look similar to this:
1015
```
1116
~ $ az login
1217
To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code F7DLMNOPE to authenticate.
@@ -26,14 +31,26 @@ To sign in, use a web browser to open the page https://aka.ms/devicelogin and en
2631
]
2732
```
2833

29-
TODO: handle multiple subscriptions?
34+
Replace the value of SUBSCRIPTION_ID with the desired subscription id where you want to deploy from the previous step. We also set the active subscription to deploy to.
35+
```
36+
SUBSCRIPTION_ID=57849302-a9f0-4908-b300-31337a0fb205
37+
az account set --subscription="${SUBSCRIPTION_ID}"
38+
```
3039

3140
## Create an Azure Service Principle
3241

3342
Next, create an Azure Service Principle that will be used to provision the ACS Kubernetes Cluster. Service Principles are entities that have permission to create resources on your behalf. New Service Principles must be given a unique name, a role, and an Azure subscription that the Service Principle may modify.
3443

3544
```
36-
$ az ad sp create-for-rbac --name="http://workflow-on-acs" --role="Contributor" --scopes="/subscriptions/<SUBSCRIPTION ID>"
45+
SP_JSON=`az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/${SUBSCRIPTION_ID}"`
46+
SP_NAME=`echo $SP_JSON | jq -r '.name'`
47+
SP_PASS=`echo $SP_JSON | jq -r '.password'`
48+
SP_TENANT=`echo $SP_JSON | jq -r '.tenant'`
49+
echo SP_JSON
50+
```
51+
52+
This should display an output similar to this. jq has also automatically extracted these values for use in the creation of the cluster.
53+
```
3754
{
3855
"appId": "58b21231-3dd7-4546-bd37-9df88812331f",
3956
"name": "http://workflow-on-acs",
@@ -44,6 +61,32 @@ $ az ad sp create-for-rbac --name="http://workflow-on-acs" --role="Contributor"
4461

4562
## Create Your ACS Kubernetes Cluster
4663

64+
You can build the Kubernetes cluster on ACS using primarily the Azure web Portal (UI) or entirely using the Azure command line (CLI). Choose one of the two paths:
65+
66+
### Path 1: Azure 'az' CLI
67+
68+
1. Create an empty Azure resource group to deploy your cluster. The location of the resource group value can be changed to any datacenter.
69+
70+
```
71+
RG_NAME=myresourcegroup
72+
az resource group create --name "${RG_NAME}" --location southcentralus
73+
```
74+
75+
2. Execute the command to deploy the cluster. The dns-prefix and ssh-key-value must be replaced with your own values.
76+
77+
```
78+
az acs create --resource-group="${RG_NAME}" --location="southcentralus" /
79+
--service-principal="${SP_NAME}" /
80+
--client-secret="${SP_PASS}" /
81+
--orchestrator-type=kubernetes --master-count=1 --agent-count=2 /
82+
--agent-vm-size="Standard_D2_v2" /
83+
--admin-username="k8sadmin" /
84+
--name="k8sanddeis" --dns-prefix="mydnsprefix" /
85+
--ssh-key-value @/home/myusername/.ssh/id_rsa.pub
86+
```
87+
88+
### Path 2: UI
89+
4790
Sign into the [Azure Portal](https://portal.azure.com) and create a new Azure Container Service:
4891

4992
![](images/step1.png)
@@ -89,8 +132,6 @@ The Kubernetes cluster will take a few minutes to complete provisioning and conf
89132

90133
![](images/step9.png)
91134

92-
Path 2: ACS Engine
93-
94135
## Connect to your Kubernetes Cluster
95136

96137
1. Find hostname for the master

0 commit comments

Comments
 (0)