Adapt public IP gathering and other
parent
d7c532c051
commit
0272261ad7
|
@ -8,13 +8,10 @@ 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.
|
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
|
```bash
|
||||||
{
|
KUBERNETES_PUBLIC_ADDRESS=MY_PUBLIC_IP_ADDRESS
|
||||||
KUBERNETES_PUBLIC_ADDRESS=$(gcloud compute addresses describe kubernetes-the-hard-way \
|
|
||||||
--region $(gcloud config get-value compute/region) \
|
|
||||||
--format 'value(address)')
|
|
||||||
|
|
||||||
kubectl config set-cluster kubernetes-the-hard-way \
|
kubectl config set-cluster kubernetes-the-hard-way \
|
||||||
--certificate-authority=ca.pem \
|
--certificate-authority=ca.pem \
|
||||||
|
@ -30,7 +27,6 @@ Generate a kubeconfig file suitable for authenticating as the `admin` user:
|
||||||
--user=admin
|
--user=admin
|
||||||
|
|
||||||
kubectl config use-context kubernetes-the-hard-way
|
kubectl config use-context kubernetes-the-hard-way
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Verification
|
## Verification
|
||||||
|
@ -41,7 +37,7 @@ Check the health of the remote Kubernetes cluster:
|
||||||
kubectl get componentstatuses
|
kubectl get componentstatuses
|
||||||
```
|
```
|
||||||
|
|
||||||
> output
|
> Output:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
NAME STATUS MESSAGE ERROR
|
NAME STATUS MESSAGE ERROR
|
||||||
|
@ -58,7 +54,7 @@ List the nodes in the remote Kubernetes cluster:
|
||||||
kubectl get nodes
|
kubectl get nodes
|
||||||
```
|
```
|
||||||
|
|
||||||
> output
|
> Output:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
NAME STATUS ROLES AGE VERSION
|
NAME STATUS ROLES AGE VERSION
|
||||||
|
|
Loading…
Reference in New Issue