K8s Playground

Pipeline Vulnerability Scan

Prerequisites

Minikube (with Kubernetes 1.25 or later), Skaffold, Helm (3.4 or later), Kubectl, Kustomize:

brew install helm kubectl kustomize minikube skaffold

Use Devbox to install instead of Homebrew:

devbox install
devbox shell

Development

Start local K8s cluster (make sure the resources to start minikube with are in line with what is configured in Docker Desktop):

minikube start --memory=4096 --cpus=4 --disk-size=30g --kubernetes-version 1.26.3

Start continuous local development with Skaffold:

skaffold dev

Monitoring

Grafana dashboard:

kubectl port-forward -n monitoring svc/kube-prometheus-stack-grafana 3000:80

(user: admin, password: prom-operator)

Note: skaffold sets up port forwarding in dev mode.

Kuberhealthy:

kubectl port-forward -n kuberhealthy svc/kuberhealthy 3001:80

Note: skaffold sets up port forwarding in dev mode.

Database

Access the database:

kubectl -n yugabyte exec -it yb-tserver-0 -- sh -c "cd /home/yugabyte && ysqlsh -h yb-tserver-0 --echo-queries"

Provision Cluster on GKE

Requires configured gcloud SDK: https://developer.hashicorp.com/terraform/tutorials/kubernetes/gke#prerequisites

cd infra/terraform
terraform init
terraform apply

Deploy to GKE

skaffold run