도커 깔기
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable docker
systemctl start docker
docker version
쿠버네티스 깔기
swapoff -a && sed -i '/swap/s/^/#/' /etc/fstab
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sudo sysctl --system
ufw disable
apt-get update & apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update && apt-get install -y kubelet=1.20.15-00 kubeadm=1.20.15-00 kubectl=1.20.15-00
apt-mark hold kubelet kubeadm kubectl
systemctl start kubelet
systemctl enable kubelet
master
kubeadm init
kubectl get nodes --all-namespaces
nodes
kubeadm join 10.100.0.105:6443 --token z5m1xl.qzbo8y9a3ym2v6cp \
--discovery-token-ca-cert-hash sha256:1eadb9353f4783b2d4f1bc832879d164b3700757f22051329f14e99cd6cf0fa7
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get nodes
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
THE END
'TEAM STUDY > 쿠버네티스' 카테고리의 다른 글
✔ 쿠버네티스 스터디 4 일차 (0) | 2022.06.15 |
---|---|
✔ 쿠버네티스 스터디 3 일차 (0) | 2022.05.30 |
쿠버네티스 실습 삽질 v.1 - 미니큐브 설치하는데 아무튼 에러 장난 아님 ;; (0) | 2022.05.24 |
✔ 쿠버네티스 스터디 2 일차 (1) | 2022.05.24 |
✔ 쿠버네티스 스터디 1 일차 (2) | 2022.05.24 |