gpt4 book ai didi

docker - 无法在microk8s中访问容器的端口

转载 作者:行者123 更新时间:2023-12-02 21:04:04 26 4
gpt4 key购买 nike

尝试在microk8s中运行容器。

根据https://docs.docker.com/get-started/part3/,在部署服务之后。
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

但是,我无法通过以下任何地址访问 bb-entrypoint服务:
  • localhost:30001
  • 10.152.183.182:8080

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

    任何的想法?

    最佳答案

    您必须通过运行kubectl get ep确保是否为此服务创建了端点
    在这种情况下,我看到未创建端点,因为该容器在从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

    关于docker - 无法在microk8s中访问容器的端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59127352/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com