Basic Commands (Beginner): create 从文件或stdin创建资源 expose 为deployment,pod创建Service。 runRun a particular image on the cluster setSet specific features on objects
Basic Commands (Intermediate): get 最基本的查询命令。如 kubectl get rs|deploy|svc explain 查看资源定义。如 kubectl explain replicaset edit 使用系统编辑器编辑资源。如 kubectl edit deploy/foo delete 删除指定资源,支持文件名、资源名、label selector。如 kubectl delete po -l foo=bar
Other Commands: api-versions Print the supported API versions on the server, in the form of "group/version" config 修改kubectl配置(kubeconfig文件),如context help Help about any command
kubectl get statefulset/foo -o=yaml --export > new.yaml
Pod亲和性帮助
1
kubectl explain pod.spec.affinity.podAffinity
kubectl get pod –watch kubectl get deployment/nginx kubectl get pod -o wide kubectl describe deployment/nginx kubectl create service clusterip my-svc-ip –tcp=80:8080 kubectl describe service my-svc-cp