按使用场景分组,点击"复制"按钮一键复制命令
kubectl version
kubectl cluster-info
kubectl get nodes
kubectl config get-contexts
kubectl config use-context <context-name>
kubectl get pods
kubectl describe pod <name>
kubectl logs -f <pod> -c <container>
kubectl exec -it <pod> -- /bin/sh
kubectl apply -f <file.yaml>
kubectl delete -f <file.yaml>
kubectl scale deployment <name> --replicas=3
kubectl get svc
kubectl port-forward svc/<name> 8080:80
kubectl -n <namespace> get pods
`kubectl top node` / `kubectl top pod`
kubectl rollout restart deployment/<name>
kubectl create configmap <name> --from-file=<key>=<file>
kubectl create secret generic <name> --from-literal=<key>=<value>
kubectl get pvc