From 7894106e3b7a2160bde1ef734de4e1ee3b021909 Mon Sep 17 00:00:00 2001 From: Xander Grzywinski Date: Tue, 28 May 2019 10:47:16 -0700 Subject: [PATCH] finished cleanup chapter --- docs/13-smoke-test.md | 8 +++++--- docs/14-cleanup.md | 48 ++++--------------------------------------- 2 files changed, 9 insertions(+), 47 deletions(-) diff --git a/docs/13-smoke-test.md b/docs/13-smoke-test.md index f302909..50c55ff 100644 --- a/docs/13-smoke-test.md +++ b/docs/13-smoke-test.md @@ -16,13 +16,15 @@ kubectl create secret generic kubernetes-the-hard-way \ Print a hexdump of the `kubernetes-the-hard-way` secret stored in etcd: ``` -gcloud compute ssh controller-0 \ - --command "sudo ETCDCTL_API=3 etcdctl get \ +EXTERNAL_IP=$(az vm show --show-details -g kubernetes-the-hard-way -n controller-0 --output tsv | cut -f19) +ssh azureuser@${EXTERNAL_IP} + +sudo ETCDCTL_API=3 etcdctl get \ --endpoints=https://127.0.0.1:2379 \ --cacert=/etc/etcd/ca.pem \ --cert=/etc/etcd/kubernetes.pem \ --key=/etc/etcd/kubernetes-key.pem\ - /registry/secrets/default/kubernetes-the-hard-way | hexdump -C" + /registry/secrets/default/kubernetes-the-hard-way | hexdump -C ``` > output diff --git a/docs/14-cleanup.md b/docs/14-cleanup.md index dc97a3a..017139e 100644 --- a/docs/14-cleanup.md +++ b/docs/14-cleanup.md @@ -1,55 +1,15 @@ # Cleaning Up -In this lab you will delete the compute resources created during this tutorial. - -## Compute Instances - -Delete the controller and worker compute instances: +In this lab you will delete the compute resources created during this tutorial. Everything you created belongs to the `kubernetes-the-hard-way` resource group, so cleaning everything up is as simple as deleteing the resource group: ``` -gcloud -q compute instances delete \ - controller-0 controller-1 controller-2 \ - worker-0 worker-1 worker-2 +az group delete --name kubernetes-the-hard-way --no-wait --yes ``` -## Networking - -Delete the external load balancer network resources: +This operation may take a while, periodically check to make sure everything was deleted: ``` -{ - gcloud -q compute forwarding-rules delete kubernetes-forwarding-rule \ - --region $(gcloud config get-value compute/region) - - gcloud -q compute target-pools delete kubernetes-target-pool - - gcloud -q compute http-health-checks delete kubernetes - - gcloud -q compute addresses delete kubernetes-the-hard-way -} +az group exists --name kubernetes-the-hard-way ``` -Delete the `kubernetes-the-hard-way` firewall rules: -``` -gcloud -q compute firewall-rules delete \ - kubernetes-the-hard-way-allow-nginx-service \ - kubernetes-the-hard-way-allow-internal \ - kubernetes-the-hard-way-allow-external \ - kubernetes-the-hard-way-allow-health-check -``` - -Delete the `kubernetes-the-hard-way` network VPC: - -``` -{ - gcloud -q compute routes delete \ - kubernetes-route-10-200-0-0-24 \ - kubernetes-route-10-200-1-0-24 \ - kubernetes-route-10-200-2-0-24 - - gcloud -q compute networks subnets delete kubernetes - - gcloud -q compute networks delete kubernetes-the-hard-way -} -```