Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
458 views
in Technique[技术] by (71.8m points)

docker - 无法在microk8s中访问容器的端口(Can't access container's port in microk8s)

Trying to run container in microk8s .

(试图在microk8s运行容器。)

According to https://docs.docker.com/get-started/part3/ , after deploy the service.

(根据https://docs.docker.com/get-started/part3/ ,在部署服务之后。)

microk8s.kubectl get services shows:

(microk8s.kubectl get services显示:)

   NAME               TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
   bb-entrypoint      NodePort    10.152.183.182   <none>        8080:30001/TCP   5m51s
   kubernetes         ClusterIP   10.152.183.1     <none>        443/TCP          35d
   microbot-service   NodePort    10.152.183.80    <none>        80:31223/TCP     19

But, I can't access the bb-entrypoint service via any of following address:

(但是,我无法通过以下任何地址访问bb-entrypoint服务:)

  • localhost:30001
  • 10.152.183.182:8080

The os is mint mate based on ( ubuntu ), and I have disabled ufw .

(操作系统是基于( ubuntu )的mint mate ,并且我禁用了ufw 。)

Any idea?

(任何的想法?)

  ask by Eric Wang translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You have to ensure whether endpoints are created for this service or not by running kubectl get ep In this case i'm seeing endpoints are not created because the pod was having issues in pulling the image from docker and so it i not in ready status

(您必须通过运行kubectl get ep来确保是否为此服务创建了端点。在这种情况下,我看到端点未创建是因为pod在从docker提取映像时遇到问题,因此它没有处于就绪状态)

[root@master tmp]# kubectl get ep
NAME            ENDPOINTS           AGE
bb-entrypoint                       9m24s

[root@master tmp]# kubectl get po
NAME                         READY   STATUS                       RESTARTS   AGE
bb-demo-7ffb568776-q6xs2     0/1     ImagePullBackOff             0          9m55s

Warning  Failed          6h15m (x3 over 6h17m)   kubelet, node1.k8s  Failed to pull image "bulletinboard:1.0": rpc error: code = Unknown desc = repository docker.io/bulletinboard not found: does not exist or no pull access
  Warning  Failed          6h15m (x3 over 6h17m)   kubelet, node1.k8s  Error: ErrImagePull
  Normal   BackOff         6h15m (x7 over 6h17m)   kubelet, node1.k8s  Back-off pulling image "bulletinboard:1.0"
  Normal   Pulling         6h14m (x4 over 6h17m)   kubelet, node1.k8s  Pulling image "bulletinboard:1.0"
  Warning  Failed          6h12m (x15 over 6h17m)  kubelet, node1.k8s  Error: ImagePullBackOff

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...