kubectl get no -o=custom-columns=“NODE:.metadata.name,ALLOCATABLE CPU:.status.allocatable.cpu,ALLOCATABLE MEMORY:.status.allocatable.memory” #查看CPU分配情况 kubectl get nodes --no-headers | awk ‘{print $1}’ | xargs -I {} sh -c ‘echo -n “{}\t” ; kubectl describe node {} | ...
语法:selector (-f FILENAME | TYPE NAME) EXPRESSIONS [—resource-version=version] kubectl set image 命令 用于更新现有资源的容器镜像。 可用资源对象包括:pod (po)、replicationcontroller (rc)、deployment (deploy)、daemonset (ds)、job、replicaset (rs)。 语法:image (-f FILENAME | TYPE NAME) CONTA...
$ kubectl cordon my-node # 清空 my-node 以待维护 $ kubectl drain my-node # 标记 my-node 可调度 $ kubectl uncordon my-node # 显示 my-node 的指标度量 $ kubectl top node my-node $ kubectl cluster-info # 将当前集群状态输出到 stdout $ kubectl cluster-info dump # 将当前集群状态输出到 ...
#标记 my-node 不可调度$kubectl cordon my-node#清空 my-node 以待维护$kubectl drain my-node#标记 my-node 可调度$kubectl uncordon my-node#显示 my-node 的指标度量$kubectl top node my-node$kubectl cluster-info#将当前集群状态输出到 stdout$kubectl cluster-info dump#将当前...
# 部分更新节点kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'# 更新容器镜像;spec.containers[*].name 是必须的,因为这是合并的关键字$ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serv...
# 部分更新节点kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' # 更新容器镜像;spec.containers[*].name 是必须的,因为这是合并的关键字$ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'# 使用具...
$ kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' # 部分更新节点 # 更新容器镜像; spec.containers[*].name 是必须的,因为这是合并的关键字 $ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'...
$ kubectl drain my-node# 清空 my-node 以待维护 $ kubectl uncordon my-node# 标记 my-node 可调度 $ kubectl top node my-node# 显示 my-node 的指标度量 $ kubectl cluster-info# 显示 master 和服务的地址 $ kubectl cluster-info dump# 将当前集群状态输出到 stdout ...
$ kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' # 部分更新节点 # 更新容器的镜像,spec.containers[*].name 是必需的,因为它们是一个合并键 $ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'...
kubectl create -f FILENAME [options] 选项如下: Options:--allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing inthe template. Only applies to golang and jsonpath output formats.--dry-run=false: If true, only print the object that...