Transforme os seus Raspberry Pi num cluster de forma rápida e indolor

Photo by Nadya Spetnitskaya on Unsplash

1. Instalação

sudo raspi-config
curl -sSL get.docker.com | sh && sudo usermod pi -aG docker
newgrp docker
sudo dphys-swapfile swapoff && sudo dphys-swapfile uninstall && \ sudo update-rc.d dphys-swapfile remove
sudo nano /boot/cmdline.txt
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory

Agora vamos reiniciar o Raspberry Pi.

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list && \
sudo apt-get update -q && sudo apt-get install -qy kubeadm
sudo kubeadm config images pull -v3

2. Configuração no “Master”

sudo kubeadm init --token-ttl=0 --pod-network-cidr=10.244.0.0/16
kubeadm join --token 9e700f.7dc97f5e3a45c9e5 192.168.0.27:6443 --discovery-token-ca-cert-hash sha256:95cbb9ee5536aa61ec0239d6edd8598af68758308d0a0425848ae1af28859bea
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
sudo sysctl net.bridge.bridge-nf-call-iptables=1

3. Configuração nos Workers

sudo sysctl net.bridge.bridge-nf-call-iptables=1
kubectl get nodes

--

--

Enthusiastically curious and raised with entrepeneurship values, I often wander outside my confort zone to explore other topics.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tiago Lucas

Tiago Lucas

Enthusiastically curious and raised with entrepeneurship values, I often wander outside my confort zone to explore other topics.