finish bootstrapping worker nodes

pull/709/head
Xander Grzywinski 2019-05-24 13:46:15 -07:00
parent 4ea7522a64
commit 070d5f247a
2 changed files with 18 additions and 14 deletions

View File

@ -248,11 +248,11 @@ done
for i in 0 1 2; do for i in 0 1 2; do
az network nic create \ az network nic create \
--resource-group kubernetes-the-hard-way \ --resource-group kubernetes-the-hard-way \
--name worker-${i}-nic --name worker-${i}-nic \
--vnet-name kubernetes-the-hard-way-vnet \ --vnet-name kubernetes-the-hard-way-vnet \
--subnet kubernetes-the-hard-way-subnet \ --subnet kubernetes-the-hard-way-subnet \
--network-security-group kubernetes-the-hard-way-nsg \ --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} \ --private-ip-address 10.240.0.2${i} \
--ip-forwarding true --ip-forwarding true
done done
@ -261,14 +261,15 @@ done
for i in 0 1 2; do for i in 0 1 2; do
az vm create \ az vm create \
--name worker-${i} \ --name worker-${i} \
--resource-group kubernetes-the-hard-way --resource-group kubernetes-the-hard-way \
--no-wait \ --no-wait \
--nics worker-${i}-nic --nics worker-${i}-nic \
--image Canonical:UbuntuServer:18.04-LTS:latest --image Canonical:UbuntuServer:18.04-LTS:latest \
--admin-username azureuser --admin-username azureuser \
--generate-ssh-keys --generate-ssh-keys \
--size Standard_B2s --size Standard_B2s \
--data-disk-sizes-gb 200 --data-disk-sizes-gb 200 \
--tags pod-cidr=10.200.${i}.0/24
done done
``` ```

View File

@ -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: 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 ### Running commands in parallel with tmux
@ -72,8 +73,7 @@ Install the worker binaries:
Retrieve the Pod CIDR range for the current compute instance: Retrieve the Pod CIDR range for the current compute instance:
``` ```
POD_CIDR=$(curl -s -H "Metadata-Flavor: Google" \ 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 ':' )
http://metadata.google.internal/computeMetadata/v1/instance/attributes/pod-cidr)
``` ```
Create the `bridge` network configuration file: Create the `bridge` network configuration file:
@ -288,8 +288,11 @@ EOF
List the registered Kubernetes nodes: List the registered Kubernetes nodes:
``` ```
gcloud compute ssh controller-0 \ EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n controller-0 --output tsv | cut -f19)
--command "kubectl get nodes --kubeconfig admin.kubeconfig" ssh azureuser@${EXTERNAL_IP}
```
```
kubectl get nodes --kubeconfig admin.kubeconfig
``` ```
> output > output