Kubernetes Cluster Setup
We will setup a Kubernetes cluster in Google Cloud. For this, you will require:
- Ensure
gcloud
is configured and able to access your Google Cloud account. This can be verified using
gcloud projects lists
- Ensure you have
helm2
symlink pointing to the Helm v2.x binary. The setup script useshelm2
to invoke Helm v2.
NOTE: Setting up a cluster in Google cloud may incur cost. Refer to
setup.sh
on the resources created.
Create Cluster
export STUDENTPROJECTNAME="Google-Cloud-Project-Name"
./setup.sh
The cluster creation script
setup.sh
will generate a scriptdestroy.sh
that can be used to delete the resources created on Google cloud
The setup.sh
will
- Create a Kubernetes cluster on Google cloud using
gcloud
- Allocate a static IP address for Ingress
- Deploy vulnerable apps and config
- Generate
kubeconfig
file in current directory - Generate
destroy.sh
script to destroy [1] and [2]
Expose Vulnerable Apps
sudo kubectl port-forward -n kube-system svc/nginx-ingress-controller 80:80
The default ingress app-ingress/app-ingress.yml
uses host names that resolves to 127.0.0.1
. The above command will forward port 80 on localhost to the Nginx Ingress
service running inside the cluster.
Destroy Cluster
./destroy.sh