Skip to content

Commit 978f668

Browse files
committed
update flow add cli
1 parent bf269d2 commit 978f668

1 file changed

Lines changed: 48 additions & 8 deletions

File tree

  • src/quickstart/provider/azure-acs

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

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
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.
43

5-
## Install and configure the Azure CLI
4+
## Prerequisites
65

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).
6+
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.
7+
2. Some form of *nix-based terminal - MacOS, Ubuntu, CentOS, Bash on Windows, etc
8+
<br>Where the following is present:
9+
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).
10+
4. SSH Key - This is used to deploy the cluster.
11+
5. jq - to parse the JSON responses from the CLI. [jq download page](https://stedolan.github.io/jq/)
812

9-
After installing the CLI, log in to your Azure Account:
13+
## Configure the Azure CLI
14+
15+
After installing the CLI, log in to your Azure Account by typing `az login` and output would look similar to this:
1016
```
1117
~ $ az login
1218
To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code F7DLMNOPE to authenticate.
@@ -26,14 +32,26 @@ To sign in, use a web browser to open the page https://aka.ms/devicelogin and en
2632
]
2733
```
2834

29-
TODO: handle multiple subscriptions?
35+
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.
36+
```
37+
SUBSCRIPTION_ID=57849302-a9f0-4908-b300-31337a0fb205
38+
az account set --subscription="${SUBSCRIPTION_ID}"
39+
```
3040

3141
## Create an Azure Service Principle
3242

3343
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.
3444

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

4563
## Create Your ACS Kubernetes Cluster
4664

47-
Path 1: UI
65+
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:
66+
67+
### Path 1: Azure 'az' CLI
68+
69+
1. Create an empty Azure resource group to deploy your cluster. The location of the resource group value can be changed to any datacenter.
70+
71+
```
72+
RG_NAME=myresourcegroup
73+
az resource group create --name "${RG_NAME}" --location southcentralus
74+
```
75+
76+
2. Execute the command to deploy the cluster. The dns-prefix and ssh-key-value must be replaced with your own values.
77+
78+
```
79+
az acs create --resource-group="${RG_NAME}" --location="southcentralus" /
80+
--service-principal="${SP_NAME}" /
81+
--client-secret="${SP_PASS}" /
82+
--orchestrator-type=kubernetes --master-count=1 --agent-count=2 /
83+
--agent-vm-size="Standard_D2_v2" /
84+
--admin-username="k8sadmin" /
85+
--name="k8sanddeis" --dns-prefix="mydnsprefix" /
86+
--ssh-key-value @/home/myusername/.ssh/id_rsa.pub
87+
```
4888

49-
Path 2: ACS Engine
89+
### Path 2: UI
5090

5191
## Connect to your Kubernetes Cluster
5292

0 commit comments

Comments
 (0)