ingress-nginx-controller安装ErrImagePull错误


一、问题描述

kubernetes官方维护的ingress nginx controller在github上的地址,kubernetes/ingress-nginx,另外,ingress-nginx官方站点也提供了安装方法,参照文档安装:
1.执行deploy.yaml文件

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.45.0/deploy/static/provider/baremetal/deploy.yaml

2.查看安装进度

kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx --watch
NAMESPACE       NAME                                        READY   STATUS             RESTARTS   AGE
ingress-nginx   ingress-nginx-admission-create-qcjrh        0/1     Completed          0          17m
ingress-nginx   ingress-nginx-admission-patch-2gjsf         0/1     Completed          1          17m
ingress-nginx   ingress-nginx-controller-77ccd9c9d6-ff5pw   0/1     ImagePullBackOff   0          17m
ingress-nginx   ingress-nginx-controller-77ccd9c9d6-ff5pw   0/1     ErrImagePull       0          18m
ingress-nginx   ingress-nginx-controller-77ccd9c9d6-ff5pw   0/1     ImagePullBackOff   0          18m

报错ErrImagePull,猜测是镜像源的问题。

二、解决办法

1.vim deploy.yaml,搜素ingress-nginx-controller

2.修改image镜像源地址

containers:
        - name: controller
          image: willdockerhub/ingress-nginx-controller:v0.45.0
          imagePullPolicy: IfNotPresent
          lifecycle:
            preStop:
              exec:
                command:
                  - /wait-shutdown

3.重新执行

kubectl apply -f deploy.yaml

问题解决:

shell>kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx
NAMESPACE       NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx   ingress-nginx-admission-create-qcjrh        0/1     Completed   0          19m
ingress-nginx   ingress-nginx-admission-patch-2gjsf         0/1     Completed   1          19m
ingress-nginx   ingress-nginx-controller-59b5545b5f-tkrsl   1/1     Running     0          85s


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM