kubectl explain 查看资源对象的详细信息(一般用一编写 yaml 的时候做一个提示 kubectl explain deployment 会出现 deployment 下面可以写的字段以及字段属性还有 可以逐级使用) kubectl get 获取一个或多个资源对象的信息 kubectl edit 使用默认编辑器编辑服务器上定义的资源对象 kubectl delete 通过 yaml/json 文件、标...
我们将创建相同的 nginx pod,这一次,让我们通过 YAML 文件来完成: apiVersion:apps/v1kind:Deploymentmetadata:name:nginxlabels:app:nginxspec:replicas:1selector:matchLabels:app:nginxtemplate:metadata:labels:app:nginxspec:containers:-name:nginximage:nginxports:-containerPort:80 不用在意 Deployment 文件语法,...
api-resources Print the supported API resources on the server api-versions Print the supported API versions on the server, in the form of "group/version" config 修改 kubeconfig 文件 plugin Runs a command-line plugin version 输出 client 和 server 的版本信息 1. 2. 3. 4. 5. 6. 7. 8. ...
验证: kubectl get nodes --show-labels 1. 2. 3. 第二步:添加nodeSelector字段到Pod配置中 最后,验证: kubectl get pods -o wide 1. apiVersion: v1 kind: Pod metadata: name: pod-example spec: nodeSelector: disktype: “ssd" containers: - name: nginx image: nginx:1.19 1. 2. 3. 4. ...
kubectl get --help 2、基本命令 2.1、create 通过文件名或标准输入创建资源。 2.1.1、创建Pod kubectl create deployment nginx --image=nginx kubectl create -f xxx.yaml 2.1.2、适合没有部署快速生成 yaml 资源编排文件 kubectl create <resource_type> <Pod_name> --image=<image_name> -o yaml --dry...
kubectl get pod pod1 kubectl get pods pod1 kubectl get po pod1 NAME:指定资源的名称。名称区分大小写。如果省略名称,则显示所有资源的详细信息:kubectlget pods。 flags:指定可选的参数。例如,可以使用-s或-server参数指定 Kubernetes API服务器的地址和端口。
kubectl api-resources NAME SHORTNAMES APIGROUP NAMESPACED KIND bindings true Binding componentstatuses cs false ComponentStatus configmaps cm true ConfigMap endpoints ep true Endpoints events ev true Event limitranges limits true LimitRange namespaces ns false Namespace ...
kubectl get kubectl get pods --selector --field-selector --sort-by排序 -o=custom-columns jsonpath go-template kubectl logs kubectl cordon kubectl drain kubectl rollout kubectl delete kubectl describe kubectl label kubectl set kubectl scale kubectl api-resources kubectl plugin list kubectl diff kubect...
kubectl api-resources 命令参考 全局参数 kubectl options 命令可以列出可以全局使用的命令参数,比较重要的有: --cluster='': 指定命令操作对象的集群 --context='': 指定命令操作对象的上下文 -n, --namespace='': 指定命令操作对象的Namespace 资源字段 ...
https://kubernetes.io/docs/reference/kubectl/overview/BasicCommands(Beginner):create Create a resource from a file or from stdin...run 在集群中运行一个指定的镜像...BasicCommands(Intermediate):explain 查看资源的文档get显示一个或更多 resources...Deploy Commands:rollout Manage the rolloutofa resource...