ingress_nginx安装以及问题解决
原创小于 1 分钟
ingress_nginx安装以及问题解决
本实践将在 Ubuntu 22.04.3LTS 系统上进行安装测试
docker版本 24.0.6
kubeadm版本 v1.28 次新版本
操作步骤
本操作要用到本站姐妹篇的hub
registry.home.com
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.9.0/deploy/static/provider/cloud/deploy.yaml
sed -i 's/registry.k8s.io/registry.home.com/g' deploy.yaml
sed -i 's/@sha256:[a-z0-9]*//g' deploy.yaml
# cat deploy.yaml | grep image: | uniq
image: registry.home.com/ingress-nginx/controller:v1.9.0
image: registry.home.com/ingress-nginx/kube-webhook-certgen:v20230407
# sudo docker pull registry.k8s.io/ingress-nginx/controller:v1.9.0
# sudo docker pull registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20230407
kubectl apply -f deploy.yaml
# 没有 EXTERNAL-IP ingress 没有 ADDRESS 配置 ingress-nginx 所在pod的IP
kubectl edit svc ingress-nginx-controller -n ingress-nginx
spec:
allocateLoadBalancerNodePorts: true
externalIPs:
- 172.xxx.xxx.xxx
# 修改配置
# https://github.com/kubernetes/ingress-nginx/blob/controller-v1.9.0/docs/user-guide/nginx-configuration/configmap.md
kubectl edit configmap ingress-nginx-controller -n ingress-nginx
data:
allow-snippet-annotations: "false"
hsts: "false"
ssl-redirect: "false"
# 查看
kubectl edit configmap ingress-nginx-controller -n ingress-nginx