A cloud-based study environment for the CKS Exam

Many of the learning goals for the CKS will require you to use a Linux machine, whether a VM or a physical box. Others will require a Kubernetes cluster. To provision such a cluster without incurring the expense of hosting one, you can set up a development environment via GitHub Codespaces.

At the time of this writing, GitHub Codespaces offers a free tier of 60 hours a month for a 2-core machine, 30 hours for 4 cores, and so forth. To get started, create a GitHub account if you don’t already have one, and create a repository.

Once you have a repository, add the following file to the repository in a new folder called .devcontainer.

.devcontainer/devcontainer.json

{
	"name": "Ubuntu",
	"image": "mcr.microsoft.com/devcontainers/base:bionic",
	"features": {
		"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
		"ghcr.io/devcontainers/features/terraform:1": {},
		"ghcr.io/devcontainers-contrib/features/digitalocean-cli:1": {},
		"ghcr.io/devcontainers/features/sshd:1": {},
		"ghcr.io/guiyomh/features/vim:0": {},
		"ghcr.io/devcontainers/features/docker-in-docker:2": {}
	}
}

Once that file exists, you’ll want to create a Codespace for the repository. Once it’s open, run minikube start from the command prompt. Your Codespace environment now has a running Kubernetes cluster for you to work in.