Add azure commands

pull/758/head
redsoxfantom 2024-01-29 12:40:01 -05:00
parent 5b958c7741
commit 8c6b105000
1 changed files with 25 additions and 17 deletions

View File

@ -8,14 +8,23 @@ 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:
Extract the public IP address of the cluster:
```gcloud```
```
{
KUBERNETES_PUBLIC_ADDRESS=$(gcloud compute addresses describe kubernetes-the-hard-way \
--region $(gcloud config get-value compute/region) \
--format 'value(address)')
```
```az```
```
KUBERNETES_PUBLIC_ADDRESS=$(az network public-ip show --name kubernetes-the-hard-way --query ipAddress -o tsv)
```
Generate a kubeconfig file suitable for authenticating as the `admin` user:
```
kubectl config set-cluster kubernetes-the-hard-way \
--certificate-authority=ca.pem \
--embed-certs=true \
@ -30,7 +39,6 @@ Generate a kubeconfig file suitable for authenticating as the `admin` user:
--user=admin
kubectl config use-context kubernetes-the-hard-way
}
```
## Verification