Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 210
Buchi Avatar asked Dec 01 '16 00:12

Buchi


2 Answers

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.

like image 160
wizawu Avatar answered Sep 22 '22 14:09

wizawu


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.

like image 40
Joe Beda Avatar answered Sep 21 '22 14:09

Joe Beda