Kubernetes notes

TODO Configuration

Extract configuration context to its own file

kubectl config view --minify --flatten \
        --context=put-the-context-here > ~/.kube/config.context

TODO Minikube

TODO Alternative container runtimes

minikube start \
    --network-plugin=cni \
    --container-runtime=containerd \
    --bootstrapper=kubeadm
# or …
minikube start \
  --network-plugin=cni \
    --extra-config=kubelet.container-runtime=remote \
    --extra-config=kubelet.container-runtime-endpoint=unix:///run/containerd/containerd.sock \
    --extra-config=kubelet.image-service-endpoint=unix:///run/containerd/containerd.sock \
    --bootstrapper=kubeadm
minikube start \
    --network-plugin=cni \
    --container-runtime=cri-o \
    --bootstrapper=kubeadm
# or …
minikube start \
    --network-plugin=cni \
    --extra-config=kubelet.container-runtime=remote \
    --extra-config=kubelet.container-runtime-endpoint=/var/run/crio.sock \
    --extra-config=kubelet.image-service-endpoint=/var/run/crio.sock \
    --bootstrapper=kubeadm

Cache some images

Depending on your workflow with minikube, you may re-create a VM from time to time (or quite a lot). In this case, you may want to speed the process up a bit.

First, you need a recent minikube version, a.k.a. v0.29.0 at least — adding image to cache with v0.28.1 is bugged and doesn’t work.

Then, it’s pretty simple and it works even if a minikube VM doesn’t work — in that case images will be loaded when doing a minikube start.

minikube cache add docker.io/library/ubuntu:18.04
# […]
minikube cache add docker.io/prom/statsd-export:v0.6.0

There is some shortcomings still, as for now, it’s not possible to download digest image.

Links