Kubectl¶
https://kubernetes.io/docs/reference/kubectl/
install¶
https://kubernetes.io/docs/tasks/tools/
curl -LO https://dl.k8s.io/release/v1.24.9/bin/windows/amd64/kubectl.exe
curl -LO https://dl.k8s.io/release/v1.24.9/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
https://github.com/Azure/kubelogin
show all info¶
list all resources in a namespace¶
kubectl get all -n <namespace> #not list all
kubectl api-resources
kubectl api-resources --verbs=list --namespaced -o name \
| xargs -n 1 kubectl get --show-kind --ignore-not-found -n <namespace>
copy files¶
copy files from local folder to k8s pod:
https://kubernetes.io/docs/reference/kubectl/generated/kubectl_cp
Requires that the
tarbinary is present in your container imagesudo apt-get update; sudo apt-get install -y tar