在kubernetes 1.23.0 部署ingress-nginx v1.1.0

最近部署ingress-nginx 0.3.0版本的时候发现,由于kubernetes版本过高,很多东西都改了,比如rbac.authorization.k8s.io就从 v1beta1 变成了 v1,所以稍微研究了下决定直接用最新的v1.1.0来部署

官方yaml地址:

https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/cloud/deploy.yaml

里面的镜像地址是:k8s.gcr.io/ingress-nginx/xxxxxxx

但是,非常坑的是我在阿里云镜像站里面没有找到对应的镜像,也无妨,我就自己做一个

直接下载:

# docker pull registry.cn-beijing.aliyuncs.com/luyouli/controller:v1.1.0

# docker pull registry.cn-beijing.aliyuncs.com/luyouli/kube-webhook-certgen:v1.1.1

ingress-nginx下载镜像

改tag(这步不操作也行,因为···没用上):

# docker tag registry.cn-beijing.aliyuncs.com/luyouli/controller:v1.1.0 k8s.gcr.io/ingress-nginx/controller:v1.1.0

# docker tag registry.cn-beijing.aliyuncs.com/luyouli/kube-webhook-certgen:v1.1.1 k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1

搞定镜像,搞起yaml,修改yaml文件(这才是主要的)

1、在yaml文件中配置nodeSelector

将三个nodeSelector的配置:

nodeSelector:
kubernetes.io/os: linux

都改为:

nodeSelector:
kubernetes.io/os: linux
ingress: “true”

2、修改image镜像

把镜像都换成 registry.cn-beijing.aliyuncs.com/luyouli/xxxxxx 并将后面的sha256删掉

# kubectl label node master ingress=true # 给master节点配置

# kubectl create -f ingress-nginx-v1.1.0.yaml

# kubectl -n ingress-nginx get pods

根据官网文档,在1.19版本之后ingress所在的apiserver和配置文件有很多的更改(纯属给自己挖坑),所以需要对应的修改配置,具体配置参考官网:

https://kubernetes.io/zh/docs/concepts/services-networking/ingress/

https://kubernetes.io/docs/reference/kubernetes-api/service-resources/ingress-v1/

3 评论

  1. Hello would you mind letting me know which webhost you’re using?
    I’ve loaded your blog in 3 different internet browsers and I must
    say this blog loads a lot quicker then most. Can you suggest a good web hosting provider at a
    reasonable price? Thank you, I appreciate it!

  2. I believe what you posted made a ton of sense.
    But, consider this, what if you were to create a awesome headline?
    I mean, I don’t wish to tell you how to run your blog, however what if you added something
    that grabbed folk’s attention? I mean 在kubernetes 1.23.0 部署ingress-nginx v1.1.0 – 鹿先森 is kinda plain. You could
    peek at Yahoo’s home page and watch how they create news titles to get people to click.

    You might add a related video or a picture or two to grab readers interested
    about what you’ve written. In my opinion, it could
    make your website a little livelier.

留下评论

error: Content is protected !!