[root@k8smaster ~]# kubectl get pods -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATESnginx-f89759699-nvjv6 1/1 Running 2 23d 10.244.1.4 k8snode1 <none> <none> 1. 影响调度的属性 总图 对node1节点 起标签名 kubectl label node node1 env_role dev 1. [root...
kubectl delete pod,service baz foo # 删除名字为baz或foo的pod和service kubectl delete pods,services -l name=myLabel # -l 参数可以删除包含指定label的资源对象 kubectl delete pod foo --grace-period=0 --force # 强制删除一个pod,在各种原因pod一直terminate不掉的时候很有用 查看资源状态 get 最常用...
// Display the details of all the pods that are managed by the replication controller named <rc-name>. // Remember: Any pods that are created by the replication controller get prefixed with the name of the replication controller. $ kubectl describe pods <rc-name> // Start streaming the l...
因此,我编写了一个函数,该函数采用Kubernetes客户端(有关制作客户端的详细信息,请参阅condue-go)和一个命名空间,并返回所有可用的 pod -func GetPods(client *meshkitkube.Client, namespace string) (*v1core.PodList, error) { // Create a pod interface for the given namespace ...
kubectl delete pods,services -l name=myLabel # -l 参数可以删除包含指定label的资源对象 kubectl delete pod foo --grace-period=0 --force # 强制删除一个pod,在各种原因pod一直terminate不掉的时候很有用 查看资源状态 get 最常用的查看命令,显示一个或多个资源的详细信息 ...
get 显示一个或更多 resources edit 在服务器上编辑一个资源 #(直接编辑现在运行中的资源) delete Delete resources by filenames, stdin, resources and names, or by resources and label selector Deploy Commands: #(业务部署时用的指令) rollout Manage the rollout of a resource #(回滚到上一次) ...
kubectl get rc,services # List all daemon sets in plain-text output format. kubectl get ds # List all pods running on node server01 kubectl get pods --field-selector=spec.nodeName=server01 kubectl describe 显示一个或多个资源的详细状态,默认包括未初始化的资源: # Display the details of ...
kubectl get rc,services exp8: 按其资源和名称列出相应信息。 kubectl get rc/web service/frontend pods/web-pod-13je7 exp9: 列出所有不同的资源对象。 kubectl get all 选项说明: --all-namespaces:false If present, list the requested object(s) across all namespaces. Namespace in current context ...
, "priority": 0 }, { "name": "Internal-IP", "type": "string", "format": "", "description": "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as ...
kubectl create clusterrole foo --verb=get,list,watch --resource=pods,pods/status Create a cluster role name "foo" with NonResourceURL specified kubectl create clusterrole "foo" --verb=get --non-resource-url=/logs/* Create a cluster role name "monitoring" with AggregationRule specified ...