This commit is contained in:
2026-01-14 11:48:02 +08:00
parent 3df4a64cef
commit b8db9d50e9
5 changed files with 102 additions and 3 deletions

View File

@@ -1,3 +1,17 @@
# 安装kubectl
```sh
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/kubectl
kubectl version --client
```
配置自动补全
```sh
source <(kubectl completion bash) # 临时生效
echo "source <(kubectl completion bash)" >> ~/.bashrc # 永久生效
```
# 设置默认 context
```sh
kubectl config use-context <context-name>