# Ubuntu 安裝 kubectl 方法
# 方法一 下載來安裝
1 | curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" |
# 方法二 透過 apt
# 添加 GPG key 與添加來源
1 | echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list |
# 安裝
1 | sudo apt install kubectl |
# 輸出 k3s Kube Config
1 | export KUBECONFIG=/etc/rancher/k3s/k3s.yaml |