赞
踩
kubectl get namespace
或者 kubectl get ns
kubectl get po -n test-namespace -o wide
kubectl describe po app-6bdd6c5f9-q7mcb -n test-namespace
kubectl logs app-6bdd6c5f9-q7mcb -n test-namespace -f --tail=100 --previous
kubectl cp -n test-namespace app-6bdd6c5f9-q7mcb:/home/files /home/files
kubectl exec -it app-6bdd6c5f9-q7mcb -n test-namespace /bin/sh
kubectl get nodes
systemctl daemon-reload && systemctl restart kubelet
#查看所有节点的标签
kubectl get node --show-labels
#添加标签
kubectl label nodes <node-name> <label-key>=<label-value>
例如:kubectl label nodes k8s-node1 node=common
#修改标签
kubectl label nodes <node-name> <label-key>=<label-value> --overwrite
例如:kubectl label nodes k8s-node1 node=common --overwrite
#删除标签
kubectl label nodes <node-name> <label-key>-
例如:kubectl label nodes k8s-node1 node-
kubectl delete pod -n namespace podname --force --grace-period=0
kubectl scale deploy/kong --replicas=2 -n cisdi-basic
kubectl get configmap app-conf -n test-namespace -o yaml
kubeadm alpha certs check-expiration
kubeadm alpha certs renew all
kubectl -n namespace get deployments -o jsonpath="{..image}" |tr -s '[[:space:]]' '\n' |sort
#查询结果去重
kubectl -n namespace get deployments -o jsonpath="{..image}" |tr -s '[[:space:]]' '\n' |sort | uniq
#查询所有运行容器正在使用的镜像列表
kubectl get pods --all-namespaces -o jsonpath="{.items[*].spec.containers[*].image}" |tr -s '[[:space:]]' '\n' |sort | uniq
kubectl cluster-info
kubectl api-resources
kubectl create deployment nginx --image=nginx:1.17.1 --dry-run=client -n dev -o yaml > test.yaml
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。