You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure Container Service (ACS) is an optimized container hosting solution that works
4
+
with all the open source tools you know. Azure is great for Kubernetes and Deis Workflow.
4
5
5
-
1. Azure Account - An active Azure Cloud account is required for this quick start. Start a trial with $200 of free credit [here](https://azure.microsoft.com/en-us/free/). After completing trial sign up, a credit card for billing must be added, but will not be charged.
6
+
If you don't yet have a Microsoft Azure account, start a trial with $200 of free credit
7
+
[here](https://azure.microsoft.com/en-us/free/).
6
8
7
-
2. Some form of *nix-based terminal - MacOS, Ubuntu, CentOS, Bash on Windows, etc
8
-
<br>Where the following is present:
9
+
## Prerequisites
9
10
10
-
3. Azure CLI - The Azure CLI (2.0) provides the `az` command which drives Azure through the command line. Install the CLI by following the instructions on [GitHub for the Azure CLI](https://github.com/Azure/azure-cli).
11
+
1. You should be able to run the `az` command, which is used to provision resources in the Azure
12
+
cloud. Either [install Azure CLI to your computer][] or open a [Cloud Shell][] by clicking
13
+
this icon near the upper right of the [Azure Portal][]: 
11
14
12
-
4. SSH Key - This is used to deploy the cluster. [This URL helps to create SSH keys compatible with Linux VMs on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys)
15
+
1. You need an SSH key to deploy the Kubernetes cluster. For help, see Microsoft's documentation
16
+
about [creating SSH key pairs][] for Linux VMs on Azure.
13
17
14
18
## Configure the Azure CLI
15
19
16
-
After installing the CLI, log in to an Azure Account by typing `az login`. Take the code offered, enter it into the text box at [https://aka.ms/devicelogin](https://aka.ms/devicelogin), and login using an Azure account which has ownership or contributor permissions over at least one subscription.
20
+
If you use [Cloud Shell][], the `az` client command is already configured.
17
21
18
-
> Note: If the Azure subscription is configured for 2FA (not done by default), the Azure account used to login must have ownership credentials to create the service principal.
22
+
If you installed `az` locally, log in to your Azure account by typing `az login` at a command
23
+
prompt and complete the confirmation code process.
19
24
20
-
```
21
-
$ az login
22
-
To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code F7DLMNOPE to authenticate.
You can verify which account is active with the `az account show` command.
38
26
39
-
The `id` field from the `az login` command is the Azure Subscription Id. This id will be used throughout the guide. As a matter of convenience, set an environment variable named `AZURE_SUBSCRIPTION_ID` with the value of the id (e.g. 57849302-a9f0-4908-b300-31337a0fb205). Check the configuration by setting the active subscription with `az account set`:
$ az account set --subscription="${AZURE_SUBSCRIPTION_ID}"
43
-
```
27
+
!!! note
28
+
Your Azure account needs ownership or contributor permissions on an Azure subscription.
44
29
45
-
## Create an ACS Kubernetes Cluster
30
+
If the subscription has 2FA enabled, your Azure account must have ownership credentials in
31
+
order to create the service principal.
46
32
47
-
Azure supports two methods to build an ACS Kubernetes cluster, through the Azure Web Portal (UI) or using the Azure command line (CLI). Choose one of the two paths:
33
+
## Create an ACS Kubernetes Cluster
48
34
49
-
### Path 1: Azure 'az' CLI
35
+
Azure Container Service can create a Kubernetes cluster using either
36
+
[the `az` command line](#option-1-command-line) or [the Azure web portal](#option-2-web-portal).
50
37
51
-
Create an empty Azure resource group to hold the ACS Kubernetes cluster. The location of the resource group can be set to any available Azure datacenter. To see the possible locations run `az account list-locations --query [].name --output tsv`
38
+
### Option 1: Command Line
52
39
53
-
Create an environment variable to hold the resource group name:
40
+
Create a group to contain the ACS Kubernetes cluster resources. Export the resource group's name
41
+
and location to environment variables for use by later commands:
54
42
55
43
```
44
+
$ # list worldwide datacenter locations so we can pick one
45
+
$ az account list-locations --query [].name --output tsv
46
+
$ export AZURE_DC_LOCATION=southcentralus # for example
56
47
$ export AZURE_RG_NAME=myresourcegroup
57
-
$ export AZURE_DC_LOCATION=mylocation
58
48
$ az group create --name "${AZURE_RG_NAME}" --location "${AZURE_DC_LOCATION}"
59
49
```
60
50
61
-
Execute the command to deploy the cluster. The `dns-prefix` and `ssh-key-value` must be replaced with your own values.
51
+
Run the `az acs create` command to create your Kubernetes cluster, replacing the `--dns-prefix`
52
+
and `--ssh-key-value` arguments below with your values:
62
53
63
54
```
64
55
$ export AZURE_SERVICE_NAME=myacs
@@ -71,92 +62,112 @@ $ az acs create --resource-group="${AZURE_RG_NAME}" --location="${AZURE_DC_LOCAT
71
62
--ssh-key-value @$HOME/.ssh/id_rsa.pub
72
63
```
73
64
74
-
> Note: When `az acs create` starts, the provisioning process runs in the background by first creating a service principal named ${AZURE_SERVICE_NAME} assigned appropriate permissions. After a few minutes the `az` command should return with information about the deployment created as shown below.
65
+
Azure Container Services immediately begins creating the Kubernetes cluster. After a few minutes,
66
+
the command returns with information about the new deployment:
Your Kubernetes cluster on Azure is ready. Skip the next section and
85
+
[connect to the ACS Kubernetes cluster](#connect-to-the-acs-kubernetes-cluster).
86
+
87
+
### Option 2: Web Portal
99
88
100
-
Sign into the [Azure Portal](https://portal.azure.com) and create a new Azure Container Service:
89
+
Sign in to the [Azure Portal](https://portal.azure.com) and create a new Azure Container Service.
90
+
Click on the **+ New** link, then the **Compute** link, then **Azure Container Service**.
101
91
102
92

103
93
104
-
Select "Resource Manager" for the deployment model:
94
+
Select **Resource Manager** as the deployment model:
105
95
106
96

107
97
108
-
Provide basic settings for the new ACS Kubernetes cluster.
98
+
Then click the **Create** button.
109
99
110
-
* User name: this is the unix user name that will be added to all master and worker nodes
111
-
* SSH public key: provide a public key that will be associated with the user name specified above
112
-
* Subscription: choose the Azure Subscription that will be charged for the compute resources
113
-
* Resource group: create a new resource group and give the group a unique name
114
-
* Location: choose an Azure location for the cluster
100
+
### Basics
115
101
116
-
When the required information is filled out, click "Ok".
102
+
Provide these *Basics* for a new Azure Kubernetes cluster:
103
+
104
+
- Orchestrator: **Kubernetes**
105
+
- Subscription: choose the Azure subscription to be charged for cloud resources
106
+
- Resource group: "Create new" with a unique name
107
+
- Location: choose one of Azure's worldwide datacenters
117
108
118
109

119
110
120
-
Create a new service principal via [instructions at this link](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authenticate-service-principal-cli#create-service-principal-with-password) and put them into the UI.
111
+
Then click the **OK** button to move on to [Master configuration](#master-configuration).
112
+
113
+
### Master configuration
121
114
122
-
* Service Principal Client ID: the name of the principal created in the example document after the `-n` parameter e.g. `exampleapp`
123
-
* Service Principal Client Secret: the password specified after the `-p` parameter or auto-generated in the Azure CLI e.g. 349d4728-438a-52a5-ad25-a740aa0bd240
115
+
First take a slight detour to [create a service principal][] to access resources. Then supply the
116
+
**Master configuration** options for your Kubernetes cluster:
117
+
118
+
- DNS name prefix: the first section of the cluster's hostname
119
+
- User name: name of a unix user who will be added to all Kubernetes nodes
120
+
- SSH public Key: a public key to authenticate the unix user specified above
121
+
- Service principal client ID: the `appId` field of the service principal
122
+
- Service principal client secret: the `password` field of the service principal
123
+
- Master count: number of Kubernetes masters for the cluster
124
124
125
125

126
126
127
-
Next, configure the number of worker nodes, the node size, and DNS prefix for the cluster.
127
+
When you are satisfied with your choices, click **OK** to move on to
128
+
[Agent Configuration](#agent-configuration).
129
+
130
+
### Agent configuration
128
131
129
-
Worker nodes should have at least 7GB of available RAM.
132
+
Choose **Agent configuration** options for your Kubernetes cluster:
130
133
131
-
Click "Ok" to continue.
134
+
- Agent count: number of Kubernetes nodes to create
135
+
- Agent virtual machine size: "Standard DS2" or better is recommended
136
+
- Operating system: Linux
132
137
133
138

134
139
135
-
Review the cluster configuration and click "Ok". After clicking "Purchase" on the next screen the browser will be returned to the Azure Portal dashboard.
140
+
When you are satisfied with your choices, click **OK** to move on to [Summary](#summary).
136
141
137
-

142
+
### Summary
138
143
139
-
The Kubernetes cluster will take a few minutes to complete provisioning and configure itself. To monitor the progress of the deployment select the "Resource Group" from the nav on the left, then select the cluster name:
144
+
Confirm the **Summary** of configuration choices for your Kubernetes cluster:
145
+
146
+

140
147
141
-

148
+
Click **OK** to tell Azure Container Services to start creating your new Kubernetes cluster. You
149
+
can monitor the progress of the deployment on the Azure dashboard, or just wait for a
150
+
notification that it has completed.
142
151
143
-

152
+
Your Kubernetes cluster on Azure is ready. Now make sure you can
153
+
[connect to the ACS Kubernetes cluster](#connect-to-the-acs-kubernetes-cluster).
144
154
145
155
## Connect to the ACS Kubernetes Cluster
146
156
147
157
`kubectl` is the Kubernetes command line client. If you don't already have it installed, you can install it with:
148
158
149
-
```console
159
+
```
150
160
az acs kubernetes install-cli
151
161
```
152
162
153
163
Download the master kubernetes cluster configuration to the ~/.kube/config file by running the following command:
154
164
155
-
```console
165
+
```
156
166
az acs kubernetes get-credentials --resource-group=$AZURE_RG_NAME --name=$AZURE_SERVICE_NAME
157
167
```
168
+
158
169
> Note: If the cluster was provisioned using any other SSH key than `/home/myusername/.ssh/id_rsa` then the `--ssh-key-file` parameter must be used pointing to the SSH key utilized to provision the cluster.
159
-
170
+
160
171
Verify connectivity to the new ACS Kubernetes cluster by running `kubectl cluster-info`
161
172
162
173
```
@@ -168,3 +179,9 @@ kubernetes-dashboard is running at https://mydnsprefix.myregion.cloudapp.azure.c
168
179
```
169
180
170
181
You are now ready to [install Deis Workflow](install-azure-acs.md)
182
+
183
+
[Azure Portal]: https://portal.azure.com/
184
+
[install Azure CLI to your computer]: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
0 commit comments