-
Notifications
You must be signed in to change notification settings - Fork 18
Create Kubernetes ACS Cluster
We will use Azure Container Service (ACS) to create a cluster on which we will run CRA workers. These instructions are adapted from the official documentation provided here. We will name our cluster cra-test
. Make sure you have an Azure account and have installed Azure CLI 2.0.
-
Open a command prompt (we prefer x64 Native Tools Command Prompt for VS 2017).
-
Run the following to ensure you have the latest components.
az component update
-
Login to Azure and set the correct subscription
az login az account set --subscription subscription_name
-
Create a resource group for CRA, named
cra-test-rg
.az group create --name=cra-test-rg --location=westus
-
Deploy Kubernetes. We will use one master and two agents in our deployment. Make sure that the value of your admin-password is between 8-123 characters long and must contain an uppercase character, a lowercase character, a numeric digit and a special character.
az acs create --orchestrator-type=kubernetes --resource-group cra-test-rg --name=cra-test --dns-prefix=cra-test --agent-count=2 --generate-ssh-keys --windows --admin-username cra-admin --admin-password your_password
-
Install
kubectl
if you do not have it already. We suggest using a simple path such asD:\kubectl
to installkubectl
, by using the--install-location
parameter to use the different path, as shown below.mkdir D:\kubectl az acs kubernetes install-cli --install-location=D:\kubectl\kubectl.exe
-
Add
D:\kubectl
to yourPATH
environment variable, and setD:\kubectl\config
as yourKUBECONFIG
environment variable. Make sure you re-open the console. -
Download the Kubernetes cluster configuration to the local
~/.kube/config
file. The downloaded config file will be in c:\users\(username)\.kube Copy the "config" file to D:\kubectl.az acs kubernetes get-credentials --resource-group=cra-test-rg --name=cra-test
-
Try running the following command to ensure you are able to access the cluster and see the nodes.
kubectl get nodes