diff --git a/docs/03-compute-resources.md b/docs/03-compute-resources.md index 7039e31..148e7a4 100644 --- a/docs/03-compute-resources.md +++ b/docs/03-compute-resources.md @@ -248,11 +248,11 @@ done for i in 0 1 2; do az network nic create \ --resource-group kubernetes-the-hard-way \ - --name worker-${i}-nic + --name worker-${i}-nic \ --vnet-name kubernetes-the-hard-way-vnet \ --subnet kubernetes-the-hard-way-subnet \ --network-security-group kubernetes-the-hard-way-nsg \ - --public-ip worker-${i}-ip + --public-ip worker-${i}-ip \ --private-ip-address 10.240.0.2${i} \ --ip-forwarding true done @@ -261,14 +261,15 @@ done for i in 0 1 2; do az vm create \ --name worker-${i} \ - --resource-group kubernetes-the-hard-way + --resource-group kubernetes-the-hard-way \ --no-wait \ - --nics worker-${i}-nic - --image Canonical:UbuntuServer:18.04-LTS:latest - --admin-username azureuser - --generate-ssh-keys - --size Standard_B2s - --data-disk-sizes-gb 200 + --nics worker-${i}-nic \ + --image Canonical:UbuntuServer:18.04-LTS:latest \ + --admin-username azureuser \ + --generate-ssh-keys \ + --size Standard_B2s \ + --data-disk-sizes-gb 200 \ + --tags pod-cidr=10.200.${i}.0/24 done ``` diff --git a/docs/09-bootstrapping-kubernetes-workers.md b/docs/09-bootstrapping-kubernetes-workers.md index bec4960..5f1eb3c 100644 --- a/docs/09-bootstrapping-kubernetes-workers.md +++ b/docs/09-bootstrapping-kubernetes-workers.md @@ -7,7 +7,8 @@ In this lab you will bootstrap three Kubernetes worker nodes. The following comp The commands in this lab must be run on each worker instance: `worker-0`, `worker-1`, and `worker-2`. Login to each worker instance using the `gcloud` command. Example: ``` -gcloud compute ssh worker-0 +EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n worker-0 --output tsv | cut -f19) +ssh azureuser@${EXTERNAL_IP} ``` ### Running commands in parallel with tmux @@ -72,8 +73,7 @@ Install the worker binaries: Retrieve the Pod CIDR range for the current compute instance: ``` -POD_CIDR=$(curl -s -H "Metadata-Flavor: Google" \ - http://metadata.google.internal/computeMetadata/v1/instance/attributes/pod-cidr) +POD_CIDR=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance/compute/tags?api-version=2018-10-01&format=text" -s | cut -f 2 -d ':' ) ``` Create the `bridge` network configuration file: @@ -288,8 +288,11 @@ EOF List the registered Kubernetes nodes: ``` -gcloud compute ssh controller-0 \ - --command "kubectl get nodes --kubeconfig admin.kubeconfig" +EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n controller-0 --output tsv | cut -f19) +ssh azureuser@${EXTERNAL_IP} +``` +``` +kubectl get nodes --kubeconfig admin.kubeconfig ``` > output