为内网LB版本的ingress创建一个独立的命名空间和docker-registry,(以仓库地址: uhub.service.ucloud.cn/ucloud_pts为例) 参考操作如下:
kubectl create ns ingress-inner
kubectl create secret docker-registry registry-secret-name
--namespace=ingress-inner
--docker-server=uhub.service.ucloud.cn/ucloud_pts
--docker-username='xxxxxxxxxxx'
--docker-password='xxxxxxxxxxx'获取 ingress-nginx chart包,修改为定制的ULB内网版本
helm repo add ingress https://kubernetes.github.io/ingress-nginx
helm repo update
helm fetch ingress/ingress-nginx
tar -xvpf ingress-nginx-3.33.0.tgz
编辑 ingress-nginx/Chart.yaml 修改以下字段
name: ingress-nginx-inner
修改 ingress-nginx/templates/controller-service.yaml 追加如下配置
metadata:
annotations:
service.beta.kubernetes.io/ucloud-load-balancer-type: inner
- 安装修改后的chart包
helm package ingress-nginx
cat > ingress-inner-value.yaml << EOF
imagePullSecrets:
- name: registry-secret-name
controller:
name: controller
ingressClass: nginx-inner
image:
repository: uhub.service.ucloud.cn/ucloud_pts/controller
tag: "v0.45.0"
digest: sha256:c892e4e39885a16324d38b213d0dd42f56d183e93836b28d051c5476b1418bc1
admissionWebhooks:
patch:
enabled: true
image:
repository: uhub.service.ucloud.cn/ucloud_pts/kube-webhook-certgen
EOF
helm del ingress-inner -n ingress-inner
helm upgrade --install ingress-inner /root/ingress-nginx-inner-3.33.0.tgz -n ingress-inner --values=ingress-inner-value.yaml