CuriousCase
CuriousCase

Reputation: 747

Is there a way to Install Kubernetes offline (without internet connection) on Ubuntu 16.04 machine

I am trying to install Install Kubernetes offline (without an internet connection) on Ubuntu 16.04 machine. Is there any procedure or steps to follow for the installation without internet connectivity?

Upvotes: -1

Views: 5348

Answers (3)

sweta ghosh
sweta ghosh

Reputation: 17

Why dont you try install k3s by following the steps below: https://docs.k3s.io/installation/airgap

Just copy the image tar and run the install script

sudo mkdir -p /var/lib/rancher/k3s/agent/images/ sudo curl -L -o /var/lib/rancher/k3s/agent/images/k3s-airgap-images-amd64.tar.zst "https://github.com/k3s-io/k3s/releases/download/v1.29.1-rc2%2Bk3s1/k3s-airgap-images-amd64.tar.zst"

Please remember to configure default route in case of no network.

Upvotes: -1

secavfr
secavfr

Reputation: 953

This is possible through downloading the apt.kubernetes.io mirror for Ubuntu 16.04 (xenial).

Use this project to download the mirror : https://github.com/flavienbwk/apt-mirror-docker

And put the following lines to your mirror.list file :

deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb https://apt.kubernetes.io kubernetes-xenial main

At this step, you must be running the server provided in the repo.

Append these lines to your client's /etc/apt/source.list :

deb http://localhost:8080/ubuntu xenial main restricted universe multiverse
deb http://localhost:8080/apt.kubernetes.io kubernetes-xenial main

Now you can install Kubernetes offline :

sudo apt update
sudo apt install kubectl kubeadm kubelet

Upvotes: 0

Pavol Krajkovič
Pavol Krajkovič

Reputation: 540

If you have one machine with no external internet connectivity, then there is no option to install k8s. However if you download all the required software/images you need to install k8s beforehand, then it is possible. Simply transfer the data between machine. Please refer to https://gist.github.com/jgsqware/6595126e17afc6f187666b0296ea0723

Upvotes: 2

Related Questions