From 4179b7facb10568680b222c38c4baab93b44fbf0 Mon Sep 17 00:00:00 2001 From: Pick1a1username <20301273+Pick1a1username@users.noreply.github.com> Date: Sat, 16 Feb 2019 19:45:03 +0900 Subject: [PATCH] The chapter 'Configuring kubectl for Remote Access' is updated. --- docs/10-configuring-kubectl.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/10-configuring-kubectl.md b/docs/10-configuring-kubectl.md index 8ac0026..49dc003 100644 --- a/docs/10-configuring-kubectl.md +++ b/docs/10-configuring-kubectl.md @@ -1,25 +1,23 @@ # Configuring kubectl for Remote Access -In this lab you will generate a kubeconfig file for the `kubectl` command line utility based on the `admin` user credentials. +In this chapter, you will generate a kubeconfig file for the `kubectl` command line utility based on the `admin` user credentials. -> Run the commands in this lab from the same directory used to generate the admin client certificates. +> Run the commands in this chapter from the same directory used to generate the admin client certificates. ## The Admin Kubernetes Configuration File -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. +Each kubeconfig requires a Kubernetes API Server to connect to. To support high availability the IP address assigned to the load balancer fronting the Kubernetes API Servers will be used. Generate a kubeconfig file suitable for authenticating as the `admin` user: ``` -{ - KUBERNETES_PUBLIC_ADDRESS=$(gcloud compute addresses describe kubernetes-the-hard-way \ - --region $(gcloud config get-value compute/region) \ - --format 'value(address)') +$ { + KUBERNETES_LB_ADDRESS=10.240.0.10 kubectl config set-cluster kubernetes-the-hard-way \ --certificate-authority=ca.pem \ --embed-certs=true \ - --server=https://${KUBERNETES_PUBLIC_ADDRESS}:6443 + --server=https://$KUBERNETES_LB_ADDRESS}:6443 kubectl config set-credentials admin \ --client-certificate=admin.pem \ @@ -38,10 +36,10 @@ Generate a kubeconfig file suitable for authenticating as the `admin` user: Check the health of the remote Kubernetes cluster: ``` -kubectl get componentstatuses +$ kubectl get componentstatuses ``` -> output +The output should look like this: ``` NAME STATUS MESSAGE ERROR @@ -55,16 +53,16 @@ etcd-0 Healthy {"health":"true"} List the nodes in the remote Kubernetes cluster: ``` -kubectl get nodes +$ kubectl get nodes ``` -> output +The output should look like this: ``` NAME STATUS ROLES AGE VERSION -worker-0 Ready 117s v1.12.0 -worker-1 Ready 118s v1.12.0 +worker-1 Ready 117s v1.12.0 worker-2 Ready 118s v1.12.0 +worker-3 Ready 118s v1.12.0 ``` Next: [Provisioning Pod Network Routes](11-pod-network-routes.md)