ID #1481

How can I add Kubernetes to an air-gapped Bright Cluster?

Kubernetes is most easily installed on a cluster that is able to access the internet. Some clusters don’t have Internet access, but it is still possible to deploy Kubernetes with a few additional steps. 

The following recipe was tested with Bright 8.2-12.

Install rpm/deb packages

Ideally a local mirror of the deb/rpm repository is configured.  If that is the case, then you can skip to the next chapter.  Otherwise the following packages (including their dependencies) should be downloaded and installed, both in the head node, and in all the software images from which Kubernetes is to be deployed:

  • cm-docker
  • cm-kubernetes-master
  • cm-kubernetes-node
  • cm-etcd
  • nginx
  • conntrack-tools (on RHEL and Suse) or conntrack (on Ubuntu)
  • cm-nvidia-docker (optional) 

In RHEL systems, you can use yumdownloader for getting those packages and related dependencies.


Get a list of container images

From the head node you can create a file with all the images:

[root@82 ~]# sed -n  's/^[ -]*image: *//p' /cm/local/apps/cm-setup/lib/python2.7/site-packages/cmsetup/plugins/kubernetes/config.yaml > images.txt 

You now have a file with all the images:

[root@82 ~]# cat images.txt

 Let us also append the pause image to the file:

[root@82 ~]# echo '' >> images.txt 

Now the images.txt file must be copied over to a computer with internet connectivity.


Download the images

From this computer with internet connectivity (and Docker installed), pull all the images:

[root@82 ~]# for image in $(cat images.txt); do docker pull $image; done

Save them in tar archives (this might take some time):

[root@82 ~]# for image in $(cat images.txt); do docker save $image -o ${image//\//_}.tar; done 

At this point you’ll have a list of tar archives:

[root@82 ~]# ls *.tar












Those tar archives have to be copied into the head node of the Bright cluster.


On the head node 

Deploy a local Docker registry

Run cm-docker-registry-setup, and choose docker-registry.

Note: in this article we’ll assume the local registry address is "registry:5000".

Provide the images to the local registry

From the head node, load the archives:

[root@82 ~]# for archive in *.tar; do docker load -i $archive; done 

Tag the images:

[root@82 ~]# registry_address=registry:5000

[root@82 ~]# for image in $(cat images.txt); do echo $image | sed "s/$registry_address/g;s/$registry_address/g;s/$registry_address/g;s/$registry_address/g;" | xargs docker tag $image; done 

Push the images to the local registry:

[root@82 ~]# for image in $(cat images.txt); do echo $image | sed "s/$registry_address/g;s/$registry_address/g;s/$registry_address/g;s/$registry_address/g;" | xargs docker push; done 

Run the Kubernetes setup wizard

Run the cm-kubernetes-setup wizard to create the required configuration file. But don't choose to "Save & Deploy". Instead, choose to "Save & Quit". 

Replace the official registries with the local one:

[root@82 ~]# sed -i "s/$registry_address/g;s/$registry_address/g;s/$registry_address/g;s/$registry_address/g;" cm-kubernetes-setup.conf 

Also, in the same .conf file you should add the last line to the Kubelet section:


     kubelet_port: 10250


     - --volume-stats-agg-period=0

     - --pod-infra-container-image=registry:5000/pause:3.1

 If the packages have been already installed, then let us change this key/value setting in the same file:

   skip_packages: true


 Run cm-kubernetes-setup with the -c option, and wait for the installation to complete:

[root@82 ~]# cm-kubernetes-setup -c cm-kubernetes-setup.conf

 If all is well, Kubernetes gets deployed without issues.

Tags: -

Related entries:

You cannot comment on this entry