From a1a94aa16a134fd3ec2c30e07ab9c2d75863105e Mon Sep 17 00:00:00 2001 From: redsoxfantom Date: Mon, 29 Jan 2024 10:33:13 -0500 Subject: [PATCH] Key k8s public address from tag --- docs/08-bootstrapping-kubernetes-controllers.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/08-bootstrapping-kubernetes-controllers.md b/docs/08-bootstrapping-kubernetes-controllers.md index b045ec1..f6c9c79 100644 --- a/docs/08-bootstrapping-kubernetes-controllers.md +++ b/docs/08-bootstrapping-kubernetes-controllers.md @@ -78,11 +78,10 @@ KUBERNETES_PUBLIC_ADDRESS=$(gcloud compute addresses describe kubernetes-the-har ```az``` ``` -sudo apt-get update -sudo apt-get install -y jq -INTERNAL_IP=$(curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq -r '.network.interface[0].ipv4.ipAddress[0].privateIpAddress') -REGION=$(curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq -r '.compute.location') -KUBERNETES_PUBLIC_ADDRESS=$(az network public-ip show --name kubernetes-the-hard-way --query ipAddress -o tsv) +INTERNAL_IP=$(curl -s -H Metadata:true --noproxy "*" \ + "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2021-02-01&format=text") +REGION=$(curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance/compute/location?api-version=2021-02-01&format=text") +KUBERNETES_PUBLIC_ADDRESS=$(curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance/compute/tagsList/0/value?api-version=2021-02-01&format=text") ``` Create the `kube-apiserver.service` systemd unit file: