kubectl常用命令
2020年1月7日小于 1 分钟
kubectl 常用命令
kubectl cluster-info
: 查看集群信息kubectl get [pods|deployments|services|rc]
: 列出资源kubectl describe
: 显示有关资源的详细信息kubectl logs <pod_name>
: 打印pod和其中容器的日志kubectl exec -it <pod_name> -- <command>
: 在pod中的容器上执行命令kubectl create -f <yaml_file>
: 创建资源kubectl delete <resource_type> <resource_name>
: 删除资源kubectl port-forward <pod_name> <local_port>:<remote_port>
: 创建端口转发kubectl scale --replicas=<number_of_replicas> deployment/<deployment_name>
: 调整pod副本数量kubectl get <resource_type> <resource_name> -o yaml
: 查看资源定义描述
原创声明
平台文章均为原创文章,未经许可,禁止转载。
如需转载,请联系作者获取授权,并注明来源及原文链接。