GunSik2 / k8s-ai

ai/bigdata/gpu examples with k8s
0 stars 0 forks source link

k3s #32

Open GunSik2 opened 3 years ago

GunSik2 commented 3 years ago

k3s

k3s server 설치

최신 안정 버전 설치

curl -sfL https://get.k3s.io | sh -

버전 지정 설치

curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.21.5+k3s2  sh -

클러스터 접속 설정 및 테스트

# vi ~/.bashrc
export KUBECONFIG=/etc/rancher/k3s/k3s.yam

# kubectl get pods -A
# kubectl get nodes -A
NAME    STATUS   ROLES                  AGE   VERSION
rpi3s   Ready    control-plane,master   20m   v1.21.5+k3s2

k3s agent 설치

Server 토큰 확인

# sudo cat /var/lib/rancher/k3s/server/node-token
K10a77642527aa799d87fb8f1694063ec6ec00908a0ee4e202fce2565947aa976dc::server:4721df4e521bd73f215eae4575c0bbee

Agent 노드 실행(Raseberry Pi)

curl -sfL https://get.k3s.io |   INSTALL_K3S_VERSION=v1.21.5+k3s2 \ 
K3S_URL=https://192.168.0.22:6443 \
K3S_TOKEN=K10a77642527aa799d87fb8f1694063ec6ec00908a0ee4e202fce2565947aa976dc::server:4721df4e521bd73f215eae4575c0bbee \
sh -

Agent 노드 실행(Jetson)

삭제

Server 삭제

/usr/local/bin/k3s-uninstall.sh  

Agent 삭제

/usr/local/bin/k3s-agent-uninstall.sh

참고자료

https://rancher.com/docs/k3s/latest/en/ https://github.com/k3s-io/k3s/blob/master/README.md https://rancher.com/docs/k3s/latest/en/advanced/#configuring-containerd