Development with Kubernetes

Daily Workflow

After Kubernetes is installed (Kubernetes for Development - Install)…

k3d list
k3d start k3s-default
kubectl get pods -w

When the pods are all running, then you can source .env.fish e.g. https://gitlab.com/kb/workflow/blob/4645-ember-workflow/.env.fish

k3d

# find the names of the clusters on your workstation
k3d list
# start a cluster
k3d start k3s-default

Set the KUBECONFIG environment variable:

# bash
export KUBECONFIG=$(k3d get-kubeconfig)
# fish
set -x KUBECONFIG (k3d get-kubeconfig)

Run kubectl commands e.g:

kubectl cluster-info

Other Commands

# delete
k3d delete k3s-default

kubectl

ConfigMap:

kubectl get configmaps -o yaml

EndPoints:

kubectl get endpoints

Ingres:

kubectl get ing

Pod:

kubectl get pod
kubectl get pods --all-namespaces
kubectl describe pod
# a specific pod (get the name from the 'get pod' command)
kubectl describe pod postgres-78b64dc858-d8ktt
# logs for a pod (get the name from the 'get pod' command)
kubectl logs postgres-78b64dc858-d8ktt -f