Kubernetes: Instalação Offline ou Instalação usando repositórios privados

From Wiki

Trabalhei em uma empresa onde as regras de segurança bloqueava o acesso a sites/repositórios externos. Essa situação dificulta em muito a instalação do Docker e Kubernetes.

Neste artigo descrevo como driblei essa situação e consegui instalar o meu cluster Kubernetes.

Criando o repositório para Arquivos e RPMs

Faça o download dos arquivos em uma estação que tenha acesso à Internet

  • Arquivos do Docker

mkdir -p docker-mirror/linux/centos/7/x86_64/stable/repodata/
mkdir -p docker-mirror/linux/centos/7/x86_64/stable/Packages/
 
cd docker-mirror/linux/centos/7/x86_64/stable/repodata/
 
wget -c https://download.docker.com/linux/centos/7/x86_64/stable/repodata/repomd.xml
wget -c https://download.docker.com/linux/centos/7/x86_64/stable/repodata/27151177db68b47d024022599f6cdb8d0758feaefd8c65e43e8313af62eed131-filelists.xml.gz
wget -c https://download.docker.com/linux/centos/7/x86_64/stable/repodata/2811439ca3c66a6cb946abe2a8e4cfea7f364e09ca9ab0f4ba10f2333b74b911-filelists.sqlite.bz2
wget -c https://download.docker.com/linux/centos/7/x86_64/stable/repodata/65c4f66e2808d328890505c3c2f13bb35a96f457d1c21a6346191c4dc07e6080-updateinfo.xml.gz
wget -c https://download.docker.com/linux/centos/7/x86_64/stable/repodata/83a7f2e6c4dffb21fe0cc818e572bb4bf2bbb8dbd860dad66179a8bbc06f64d9-other.xml.gz
wget -c https://download.docker.com/linux/centos/7/x86_64/stable/repodata/b292d47325588b6eb4f589e04bbf0f95727fa1755d8fa65d6978e1294f11b167-primary.sqlite.bz2
wget -c https://download.docker.com/linux/centos/7/x86_64/stable/repodata/c2d756b11328eaa080323355c4b1c1d9442bbe8798b183b79fa53841274f1633-other.sqlite.bz2
wget -c https://download.docker.com/linux/centos/7/x86_64/stable/repodata/ff7792a80a96a8fd9eb9843f830bf7ffc031e67eef965d918f724f250b9e38bc-primary.xml.gz
 

cd ../Packages/

wget -c https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.03.3.ce-1.el7.x86_64.rpm wget -c https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.3.ce-1.el7.noarch.rpm wget -c https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-18.06.3.ce-3.el7.x86_64.rpm wget -c https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-18.09.6-3.el7.x86_64.rpm wget -c https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-18.09.6-3.el7.x86_64.rpm wget -c https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.5-3.1.el7.x86_64.rpm


# Kubernetes Mirror
mkdir -p kubernetes-mirror/yum/repos/kubernetes-el7-x86_64/repodata/filelists.xml
cd kubernetes-mirror/1.11.9
wget -c https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/kubelet-1.11.9
wget -c https://packages.cloud.google.com/yum/repos//kubeadm-1.11.9
wget -c https://packages.cloud.google.com/yum/repos//kubectl-1.11.9
cd ../..
  • cfssl mirror
mkdir -p cfssl-mirror/R1.2
cd cfssl-mirror/R1.2
wget -c http://pkg.cfssl.org/R1.2/cfssl_linux-amd64
wget -c http://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
wget -c http://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64
cd ../..
  • Etcd
mkdir -p etcd-mirror/etc/v3.1.13
cd etcd-mirror/etc/v3.1.13
wget -c https://storage.googleapis.com/etcd/v3.1.13/etcd-v3.1.13-linux-amd64.tar.gz
cd ../..

Ver também