Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Kubernetes 集群中,我们可以创建一个工作负载并在两个单独的命令中公开它。
我们可以在一个命令中完成吗?
这可以通过以下命令来实现。它将创建一个工作负载并同时公开它。
kubectl 运行 nginx-digital --image=nginx --expose=true --port=80
上面的命令将创建一个部署nginx-digital并在端口80上使用名称为nginx-digital的ClusterIP服务公开它。