标签:kubectl 命令
kubectl常用创建和查看操作kubectl create -f nginx-deployment.yaml
查看deployment
kubectl get deployment
kubectl get pod -o wide
kubectl describe pod nginx-deployment-75d56bb955-bzkv4
curl --head 10.0.0.2
kubectl set image deployment/nginx-deployment nginx=nginx:1.12.2 --record
kubectl get deployment -o wide
--record
参数)
kubectl rollout history deployment
kubectl rollout history deployment/nginx-deployment --revision=2
快速回滚到上一个版本
kubectl rollout undo deployment/nginx-deployment
kubectl scale deployment nginx-deployment --replicas 2
ipvsadm -Ln
1.创建资源对象
kubectl create -f my-service.yaml -f my-rc.yaml
kubectl create -f <dir>
kubectl get pods
kubectl get rc,service
3.描述资源对象
kubectl describe nodes <node-name>
kubectl describe pods/<pod-name>
kubectl describe pods <rc-name>
kubectl delete -f pod.yaml
kubectl delete pods, services -l name=<label-name>
kubectl delete pods --all
执行容器的命令
kubectl exec <pod-name> date
kubectl exec <pod-name> -c <container-name> date
kubectl exec -it <pod-name> -c <container-name> /bin/bash
kubectl logs <pod-name>
kubectl logs -f <pod-name> -c <container-name>
标签:kubectl 命令
原文地址:http://blog.51cto.com/tryingstuff/2129034