kubectl
Run commands against Kubernetes clusters. Some subcommands such as
runhave their own usage documentation. More information: https://kubernetes.io/docs/reference/kubectl/.
- List information about a resource with more details:
kubectl get wide
- Update specified pod with the label
unhealthyand the valuetrue:
kubectl label pods unhealthy=true
- List all resources with different types:
kubectl get all
- Display resource (CPU/Memory/Storage) usage of nodes or pods:
kubectl top
- Print the address of the master and cluster services:
kubectl cluster-info
- Display an explanation of a specific field:
kubectl explain
- Print the logs for a container in a pod or specified resource:
kubectl logs
- Run command in an existing pod:
kubectl exec --
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
