2、查看资源对象简写(缩写):kubectl api-resources [root@master ~]# kubectl api-resources Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVer...
selectorlSelector (label query) to filter on, supports '=', '==', and '!='. show-allafalseWhen printing, show all resources (default hide terminated pods.) show-kindfalseIf present, list the resource type for the requested object(s). ...
Deployments are another core Kubernetes resources that run the containerized application inside the pods. The deployment manages and operates the running pods with the help of replicas. To view the logs of deployment, follow the below-listed steps. Step 1: Get All Kubernetes Resources To list dow...
kubectl delete ([-f FILENAME] | [-k DIRECTORY] | TYPE [(NAME | -l label | --all)]) [options] 选项如下: Options:--all=false: Delete all resources, including uninitialized ones, in the namespace of the specified resource types.-A, --all-namespaces=false: If present, list the reque...
可以通过命令kubectl api-resources来查看所有api资源 [centos@k8s-master ~]$ kubectl api-resources NAME SHORTNAMES APIGROUP NAMESPACED KIND bindingstrueBinding componentstatuses csfalseComponentStatus configmaps cmtrueConfigMap endpoints eptrueEndpoints ...
cmdutil.AddLabelSelectorFlagVar(cmd,&o.LabelSelector)# 添加"--subresource"的 flag cmdutil.AddSubresourceFlags(cmd,&o.Subresource,"If specified, gets the subresource of the requested object.",supportedSubresources...)returncmd}# 对 GetOptions 中参数进行补全func(o*GetOptions)Complete(f cmdutil....
kubectl api-resources #查看集群信息 kubectl cluster-info #配置kubectl自动补全 source <(kubectl completion bash) #node节点查看日志 journalctl -u kubelet -f 二、基本信息查看 kubectl get <resource> [-o wide|json|yaml] [-n namespace] 获取资源的相关信息,-n 指定命令空间,-o 指定输出格式 ...
explain Get documentation for a resource 获取多种资源的文档。例如 Pod、Node、Service 等 kubectl explain [--recursive=false] [flags] get Display one or many resources 列出一个或多个资源。 kubectl get (-f FILENAME | TYPE [NAME | /NAME | -l label]) [--watch] [--sort-by=FIELD] [[-...
getDisplay one or many resources edit Edit a resource on the server delete Delete resources by filenames, stdin, resources and names, or by resources and label selector Deploy Commands: rollout Manage the rollout of a resource scale Set a new sizefora Deployment, ReplicaSet or Replication Con...
kubectl set resources 命令 这个命令用于设置资源的一些范围限制。 资源对象中的Pod可以指定计算资源需求(CPU-单位m、内存-单位Mi),即使用的最小资源请求(Requests),限制(Limits)的最大资源需求,Pod将保证使用在设置的资源数量范围。 对于每个Pod资源,如果指定了...