[ Descomplicando o Kubernetes ] 04 - Configurando um cluster kubernetes sem o docker

Atualizado: Mar 12


Bora lá para mais um SIGA O VIDEO!

Basta dar play no video e acompanhar abaixo todos os comandos que foram utilizados para construir o cluster Kubernetes sem o Docker!


Deixe seus comentários abaixo e compartilhem com seus amigos!




SIGA O VIDEO!


Portas necessárias para o cluster:


MASTER

kube-apiserver => 6443 TCP

etcd server API => 2379-2380 TCP

Kubelet API => 10250 TCP

kube-scheduler => 10251 TCP

kube-controller-manager => 10252 TCP

Kubelet API Read-only => 10255 TCP

WORKER

Kubelet API => 10250 TCP

Kubelet API Read-only => 10255 TCP

NodePort Services => 30000-32767 TCP


# vim /etc/modules-load.d/k8s.conf

br_netfilter

ip_vs_rr

ip_vs_wrr

ip_vs_sh

nf_conntrack_ipv4

ip_vs


# vim /etc/sysctl.d/k8s.conf

net.bridge.bridge-nf-call-ip6tables = 1

net.bridge.bridge-nf-call-iptables = 1

net.ipv4.ip_forward=1


# sysctl --system


# yum upgrade -y


# yum install -y vim bash-completion wget


# reboot


# vim /etc/yum.repos.d/k8s.repo

[kubernetes]

name=Kubernetes

baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64

enabled=1

gpgcheck=1

repo_gpgcheck=1

gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg


# yum install -y kubelet kubeadm kubectl


# systemctl enable kubelet


# systemctl start kubelet


# wget https://github.com/containerd/containerd/releases/download/v1.2.1/containerd-1.2.1.linux-amd64.tar.gz


# tar xf containerd-1.2.1.linux-amd64.tar.gz -C /usr/local/ # wget -O /usr/local/sbin/runc https://github.com/opencontainers/runc/releases/download/v1.0.0-rc6/runc.amd64


# chmod 755 /usr/local/sbin/runc # containerd --version


# runc --version


# curl -o /etc/systemd/system/containerd.service https://raw.githubusercontent.com/containerd/cri/master/contrib/systemd-units/containerd.service

# systemctl daemon-reload


# systemctl enable containerd


# systemctl start containerd


# systemctl status containerd


# echo "runtime-endpoint: unix:///run/containerd/containerd.sock" > /etc/crictl.yaml

# vim /etc/systemd/system/kubelet.service.d/0-containerd.conf [Service] Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:///run/containerd/containerd.sock"

# systemctl daemon-reload


# setenforce 0


# systemctl stop firewalld


# systemctl disable firewalld


# swapoff -a


# vim /etc/fstab


# kubeadm init --cri-socket /run/containerd/containerd.sock


# 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://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"


# kubeadm token create --print-join-command


# kubeadm join --cri-socket /run/containerd/containerd.sock --token <TOKEN> MASTER_IP:6443 --discovery-token-ca-cert-hash sha256:37092 --ignore-preflight-errors=all


# kubectl get nodes


# crictl ps


# crictl --help

1,317 visualizações