Usually k3s is installed with a shell script:
curl -sL get.k3s.io | sh
This will download the k3s binary create a systemd service and start it. Start time includes the download of system images:
- docker.io/rancher/klipper-helm
- docker.io/rancher/mirrored-library-traefik
- docker.io/rancher/mirrored-metrics-server
- docker.io/rancher/mirrored-coredns-coredns
- docker.io/rancher/local-path-provisioner
- docker.io/rancher/klipper-lb
- docker.io/rancher/mirrored-library-busybox
- docker.io/rancher/mirrored-pause
To speed-up startup time, you can pre download images (make part of your vm/docker image) with the 3 lines above: [00-k3s-airgap-images.sh]
Lets say you want to add nginx golang and alpine to the prewarmed images, you can use crane to download images:
# install crane
curl -sL https://github.com/google/go-containerregistry/releases/download/v0.16.1/go-containerregistry_Linux_x86_64.tar.gz | tar -xz -C /usr/local/bin/ crane
download images
for img in alpine nginx:alpine golang:alpine; do
crane pull ${img} /var/lib/rancher/k3s/agent/images/${img}.tar
done
to figure put the system image names you can start up k3s and after 1 minute or so:
kubectl get no -o jsonpath='{range .items[0].status.images[*].names[0]}{$}{"\n"}{end}'