Destroying the Cluster

In this lesson, we will destroy the cluster we created in the starting lessons of this chapter.

Storing the Environment Variables#

The chapter 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.

We echoed the variables with the values into the kops file.

Destroying Everything#

Now we can delete the cluster.

The output is as follows.

Kops removed references of the cluster from our kubectl configuration and proceeded to delete all the AWS resources it created. Our cluster is no more. We can proceed and delete the S3 bucket as well.

We will not remove the IAM resources (group, user, access key, and policies). It does not cost to keep them in AWS, and we’ll save ourselves from re-running the commands that create them. However, we will list the commands as a reference.

⚠️ Do NOT execute commands from below. They are only a reference. We’ll need those resources in the next chapter.


In the next lesson, we will test our understanding of this chapter with the help of a quick quiz.

Giving Others Access to the Cluster
Comparison with Docker Swarm
Mark as Completed
Report an Issue