diff --git a/docs/03-compute-resources.md b/docs/03-compute-resources.md index fde4b4c..43a2335 100644 --- a/docs/03-compute-resources.md +++ b/docs/03-compute-resources.md @@ -53,7 +53,7 @@ az network nsg rule create \ --protocol Tcp \ --direction Inbound \ --priority 100 \ - --source-address-prefix Any \ + --source-address-prefix "*" \ --source-port-range "*" \ --destination-port-ranges 22 6443 ``` @@ -303,11 +303,25 @@ worker-2 kubernetes-the-hard-way westus2 SSH will be used to configure the controller and worker instances. When building the compute instances, if you don't currently have an SSH keypair, one will be generated for you and stored in your ~/.ssh directory -Test SSH access to the `controller-0` compute instances using the VMs public IP address (this can be found by list your VMs with the CLI, or by looking at the VM in the Azure portal): +Let's build an SSH config file to easily be able to SSH to all our controller and worker nodes throughout the lab: ``` -EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n controller-0 --output tsv | cut -f19) -ssh azureuser@${EXTERNAL_IP} +for instance in controller-0 controller-1 controller-2 worker-0 worker-1 worker-2; do + EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n ${instance} --output tsv | cut -f19) + cat < This tutorial sets the Kubelet `--authorization-mode` flag to `Webhook`. Webhook mode uses the [SubjectAccessReview](https://kubernetes.io/docs/admin/authorization/#checking-api-access) API to determine authorization. ``` -EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n controller-0 --output tsv | cut -f19) -ssh azureuser@${EXTERNAL_IP} +ssh controller-0 ``` Create the `system:kube-apiserver-to-kubelet` [ClusterRole](https://kubernetes.io/docs/admin/authorization/rbac/#role-and-clusterrole) with permissions to access the Kubelet API and perform most common tasks associated with managing pods: diff --git a/docs/09-bootstrapping-kubernetes-workers.md b/docs/09-bootstrapping-kubernetes-workers.md index 5f1eb3c..ad9da62 100644 --- a/docs/09-bootstrapping-kubernetes-workers.md +++ b/docs/09-bootstrapping-kubernetes-workers.md @@ -4,11 +4,10 @@ In this lab you will bootstrap three Kubernetes worker nodes. The following comp ## Prerequisites -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 `ssh`. Example: ``` -EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n worker-0 --output tsv | cut -f19) -ssh azureuser@${EXTERNAL_IP} +ssh worker-0 ``` ### Running commands in parallel with tmux @@ -288,8 +287,7 @@ EOF List the registered Kubernetes nodes: ``` -EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n controller-0 --output tsv | cut -f19) -ssh azureuser@${EXTERNAL_IP} +ssh controller-0 ``` ``` kubectl get nodes --kubeconfig admin.kubeconfig