Can we install Kubernetes in a complete offline mode with kubeadm?
I don't think that anyone has documented this yet. The biggest thing needed is to get the right images pre-loaded on every machine in the cluster. After that things should just work.
There was some discussion of this in this PR: https://github.com/kubernetes/kubernetes/pull/36759.
If I had the bandwidth I'd implement a kubeadm list-images
so we could do docker save $(kubeadm list-images) | gzip > kube-images.tar.gz
. You could manually construct that list by reading code and such.
Can we install Kubernetes in a complete offline mode with kubeadm?
Yes, I've already set up several offline clusters (1.15.x) with ansible and kubeadm. Mainly you need to prepare the following things in a USB drive and bring it to your offline environment.
- .deb/.rpm files to install ansible
- .deb/.rpm files to install docker
- .deb/.rpm files to install kubeadm, kubectl, kubelet
- Docker images of kubernetes cluster (You can find that with
kubeadm config images list
) - Docker images of kubernetes addons (flannel/calico, dashboard, etc)
- Your ansible playbooks
The installation steps are as follow:
- Install ansible with dpkg or rpm (manully)
- Install docker with dpkg or rpm (via ansible tasks)
- Install kubeadm, kubectl, kubelet with dpkg or rpm (via ansible tasks)
docker load
all the docker images (via ansible tasks)- Run
kubeadm init
andkubeadm join
(via ansible tasks)
There may be lots of details here. Feel free to leave your comments.