Technical requirements
For this chapter, as with most of the chapters in this book, you will need a Kubernetes cluster running. Although you can run these tests on something such as Minikube, it’s highly recommended to create a Kubeadm cluster or a Kubernetes managed service cluster in the cloud with something such as Azure Kubernetes Service (AKS), Amazon Elastic Kubernetes Service (Amazon EKS), or Google Kubernetes Engine (GKE). The reason why is that you should see what it’s truly like from a production perspective to run Kubernetes security tests, which will open your eyes to see how secure (or insecure) it is out of the box and what you can do to mitigate those risks.
If you want to deploy a Kubeadm cluster, check out this Git repo for help:
https://github.com/AdminTurnedDevOps/Kubernetes-Quickstart-Environments/tree/main/Bare-Metal/kubeadm
For the overall code used in this chapter, you can find it here: