[ 查看nodes ]
# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready control-plane 2y100d v1.24.10
k8s-node01 Ready <none> 2y100d v1.24.10
k8s-node02 Ready <none> 2y100d v1.24.10
[ 查看集群信息 ]
# kubectl cluster-info
Kubernetes control plane is running at https://192.168.223.201:6443
CoreDNS is running at https://192.168.223.201:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
[ 创建命名空间slb ]
# kubectl create namespace slb
namespace/slb created
[ 在指定的命名空间下,使用1.20.1版本的nginx镜像,创建一个deployment,名称为web ]
# kubectl create deployment web --image=nginx:1.22.1 -n slb
deployment.apps/
【Kubernetes】Kubernetes常用命令总结
于 2021-08-23 09:08:53 首次发布