🍰k3s를 사용한 k8s 테스트 환경 구성
K3s
K3s vs K8s
K3s
K8s
Features
Architecture of k3s
Installation
Uninstall K3s
Reference
Last updated
Last updated
# 아래 명령어들은 single node ubuntu server 에서root 계정으로 진행
# 빠른 설치 명령어
curl -sfL https://get.k3s.io | sh -s - server --docker
# k3s 가 잘 설치되었는지 설정 yaml 파일 여부를 확인
cat /etc/rancher/k3s/k3s.yaml
# 쿠버네티스 클러스터 설정을 위해
mkdir .kube # 폴더가 없는 경우 생성
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config # 쿠버네티스의 설정 파일을 k3s 것으로 사용
chown $USER:$USER ~/.kube/config # user가 접근할 수 있는 권한 업데이트root@<server>:~# kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
server Ready control-plane,master 5m34s v1.21.7+k3s1 11.11.111.11 <none> Ubuntu 20.04.2 LTS 5.15.0-46-generic docker://20.10.17kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.10.0/nvidia-device-plugin.ymlkubectl get pod -n kube-system | grep nvidiakubectl get nodes "-o=custom-columns=NAME:.metadata.name,GPU:.status.allocatable.nvidia\.com/gpu"# Uninstalling Servers
# To uninstall K3s from a server node, run:
/usr/local/bin/k3s-uninstall.sh
# Uninstalling Agents
# To uninstall K3s from an agent node, run:
/usr/local/bin/k3s-agent-uninstall.sh # optional?