The appendix is almost finished, and we do not need the cluster anymore. We want to destroy it as soon as possible. There's no good reason to keep it running when we're not using it. But, before we proceed with the destructive actions, we'll create a file that will hold all the environment variables we used in this chapter. That will help us the next time we want to recreate the cluster.
1 echo "export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID 2 export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY 3 export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION 4 export ZONES=$ZONES 5 export NAME=$NAME" \ 6 >kops
We echoed the variables with the values into the kops file, and now we can delete the cluster.
1 kops delete cluster \ 2 --name $NAME \ 3 --yes
The output is as follows.
... Deleted kubectl config for...