我正试图暴露我的豆荚
kubectl expose deployment hello-node-64c578bdf8-jp7dt --type=LoadBalancer --port=8080
Error from server (NotFound): deployments.extensions "hello-node-64c578bdf8-jp7dt" not found
这些是我的豆荚
kubectl get pods
NAME READY STATUS RESTARTS AGE
hazelcast-76c4785db6-wnzsb 0/1 ImagePullBackOff 0 120m
hello-minikube-7bdc84f4b7-qfjv9 1/1 Running 0 113m
hello-node-64c578bdf8-jp7dt 1/1 Running 0 114m
我的kubectl版本
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:37:52Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:30:26Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
这些部署扩展是什么?
kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
hazelcast 0/1 1 0 139m
hello-minikube 1/1 1 1 132m
hello-node 1/1 1 1 133m
答案 0 :(得分:3)
使用以下方式获取部署:
kubectl get deployments
然后在暴露命令中使用该名称。也许您正在尝试公开广告连播的名称
因此正确的命令是:
kubectl expose deployment hello-node --type=LoadBalancer --port=8080
答案 1 :(得分:1)
使用以下命令获取部署:
kubectl get deployments --all-namespaces
NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
app hello-node 1/1 1 1 22m
然后在暴露命令中使用该名称。也许您正在尝试公开广告连播名称
因此正确的命令是:
kubectl expose deployment hello-node --type=LoadBalancer --port=8080 -n app