Can we install Kubernetes in a complete offline mode with kubeadm?

12/1/2016

I need to install a Kubernetes cluster in complete offline mode. I can follow all the instructions at http://kubernetes.io/docs/getting-started-guides/scratch/ and install from binaries but that seems like an involved setup. The installation using kubeadm is pretty easy but I don't see any docs on whether I can install the cluster by downloading the .deb packages locally.

Any pointers to that direction are much appreciated.

-- Buchi
kubeadm
kubernetes
offline

2 Answers

12/1/2016

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.

-- Joe Beda
Source: StackOverflow

10/21/2019

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:

  1. Install ansible with dpkg or rpm (manully)
  2. Install docker with dpkg or rpm (via ansible tasks)
  3. Install kubeadm, kubectl, kubelet with dpkg or rpm (via ansible tasks)
  4. docker load all the docker images (via ansible tasks)
  5. Run kubeadm init and kubeadm join (via ansible tasks)

There may be lots of details here. Feel free to leave your comments.

-- wizawu
Source: StackOverflow