From 0272261ad75a686e8247b2bad746edc8adb35215 Mon Sep 17 00:00:00 2001 From: Nemo Date: Sat, 20 Jun 2020 15:36:15 +0200 Subject: [PATCH] Adapt public IP gathering and other --- docs/10-configuring-kubectl.md | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/docs/10-configuring-kubectl.md b/docs/10-configuring-kubectl.md index 84177f3..9b3098f 100644 --- a/docs/10-configuring-kubectl.md +++ b/docs/10-configuring-kubectl.md @@ -8,29 +8,25 @@ In this lab you will generate a kubeconfig file for the `kubectl` command line u Each kubeconfig requires a Kubernetes API Server to connect to. To support high availability the IP address assigned to the external load balancer fronting the Kubernetes API Servers will be used. -Generate a kubeconfig file suitable for authenticating as the `admin` user: +Generate a kubeconfig file suitable for authenticating as the `admin` user (replace MY_PUBLIC_IP_ADDRESS with your public IP address on the `gateway-01` VM): ```bash -{ - KUBERNETES_PUBLIC_ADDRESS=$(gcloud compute addresses describe kubernetes-the-hard-way \ - --region $(gcloud config get-value compute/region) \ - --format 'value(address)') +KUBERNETES_PUBLIC_ADDRESS=MY_PUBLIC_IP_ADDRESS - kubectl config set-cluster kubernetes-the-hard-way \ - --certificate-authority=ca.pem \ - --embed-certs=true \ - --server=https://${KUBERNETES_PUBLIC_ADDRESS}:6443 +kubectl config set-cluster kubernetes-the-hard-way \ + --certificate-authority=ca.pem \ + --embed-certs=true \ + --server=https://${KUBERNETES_PUBLIC_ADDRESS}:6443 - kubectl config set-credentials admin \ - --client-certificate=admin.pem \ - --client-key=admin-key.pem +kubectl config set-credentials admin \ + --client-certificate=admin.pem \ + --client-key=admin-key.pem - kubectl config set-context kubernetes-the-hard-way \ - --cluster=kubernetes-the-hard-way \ - --user=admin +kubectl config set-context kubernetes-the-hard-way \ + --cluster=kubernetes-the-hard-way \ + --user=admin - kubectl config use-context kubernetes-the-hard-way -} +kubectl config use-context kubernetes-the-hard-way ``` ## Verification @@ -41,7 +37,7 @@ Check the health of the remote Kubernetes cluster: kubectl get componentstatuses ``` -> output +> Output: ```bash NAME STATUS MESSAGE ERROR @@ -58,7 +54,7 @@ List the nodes in the remote Kubernetes cluster: kubectl get nodes ``` -> output +> Output: ```bash NAME STATUS ROLES AGE VERSION