Back to Homepage

Kubernetes Development

k3d/README.md

1.12.32.0 KB
Original Source

Kubernetes Development

These configs and scripts attempt to simplify spinning up a kubernetes cluster for development and testing purposes. It leverages k3d to create a k3s cluster in Docker. Homepage can then be deployed either via the k3d-deploy.sh script, or tilt can be used to spin up a local CI loop that will automatically update the deployment.

All the commands in the document should be run from the k3d directory.

Requisite Tools

ToolDescription
dockerDocker container runtime
kubectlKubernetes CLI
helmKubernetes package manager
k3dKubernetes on Docker - used to create the cluster
k9s(Optional) Command line view for kubernetes cluster
tilt(Optional) Local CI loop for kubernetes deployment
direnv(Optional) Automatically loads kubeconfig via .envrc

One-off Test Deployments

Create a cluster:

sh
./k3d-up.sh

Build and deploy:

sh
./k3d-deploy.sh

Open the Homepage deployment:

sh
xdg-open http://homepage.k3d.localhost:8080/

Continuous Deployment

Create a cluster:

sh
./k3d-up.sh

Kick off tilt:

sh
tilt up

Press space bar to open the tilt web UI, which is quite informative.

Finally, open the Homepage deployment:

sh
xdg-open http://homepage.k3d.localhost:8080/