一、Pods

1、Get all pods in the current namespace

2、Get pods in all namespaces

3、Get pods with more details

4、Get the yaml for a pod

5、Inspect a pod

6、Get pods sorted by a metric

7、Get pods with their labels

8、Get pods that match a label

9、Forward traffic from a localhost port to a pod port

10、Run a command on a pod

11、Run a command on a container in a pod

二、Secrets

1、Get all secrets in the current namespace

2、Get secrets in all namespaces

3、Get secrets with more details

4、Get the contents of a secret

三、Services

1、Get all services in the current namespace

2、Get services in all namespaces

3、Get services with more details

4、Get the yaml for a services

5、Inspect a service

6、Get service's labels

7、Get services that match a label

四、Updating Resources

1、Roll a new version of a deployment

2、Check the deployment history

3、Rollback a deployment

4、Rollback to a specific version

5、Watch a rolling update

6、Restart the rolling deploy

7、Edit a resource’s yaml

8、Scale a deployment to 3 pods

9、Delete a pod

五、Context

1、Show contexts

2、Show current context

3、Switch context to another cluster

4、Change Namespace

六、Logs

1、Show logs (stdout) of a pod

2、Show logs (stdout) of pods that match a label

3、Show logs of a previous instantiation of a container

4、Show logs for a specific container in a pod (i.e. init container)

5、Following logs from a pod

6、Follow all logs from a pod that match a label

7、Show logs with verbosity level of logs from 0 - 9

七、Deployments

1、Get all deployments in the current namespace

2、Get deployments in all namespaces

3、Get deployments with more details

4、Get the yaml for a deployment

5、Inspect a deployment

6、Get deployment's labels

7、Get deployments that match a label

八、Ingress

1、Get all ingress in the current namespace

2、Get ingress in all namespaces

3、Get ingress with more details

4、Get the yaml for a ingress

5、Inspect a ingress

6、Get ingress labels

7、Get ingress that match a label

九、Creating Resources

1、Create a kubernetes resource from a file

2、Create kubernetes resources from multiple files

3、Create resources from all manifest files in a directory

4、Create resource from a url

5、Start a single instance of an image

十、Nodes

1、Mark node as unschedulable

2、Drain a node for maintenance

3、Mark node as schedulable

4、Show ‘top’ metrics for a node

5、Display addresses of the master and services

6、ump current cluster state to stdout

7、Show a list of eligible kube resource (i.e. pods, service, pv, etc)

8、Show a list of eligible kube resources in your namespace

1:查看某个命名空间的pod
kubectl get pod
2:查看 RC 和 service 列表
3:kubectl run 在集群中运行一个指定的镜像
4:kubectl expose 创建Service对象以将应用程序"暴露"于网络中
5:kubectl get 显示一个或更多resources资源
6:kubectl clster-info 显示集群信息
7:kubectl describe 描述资源对象
8:生成yaml资源配置文件方法