nginx-ingress
小于 1 分钟
Ingress 为外部访问集群提供了一个 统一入口,避免了对外暴露集群端口;功能类似 Nginx,可以根据域名、路径把请求转发到不同的 Service,通过反向代理实现负载均衡。
ingress-nginx-controller:解决服务暴露与负载均衡问题
安装
拉取charts
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
❯ helm search repo ingress-nginx
NAME CHART VERSION APP VERSION DESCRIPTION
ingress-nginx/ingress-nginx 4.8.4 1.9.4 Ingress controller for Kubernetes using NGINX a...
helm pull ingress-nginx/ingress-nginx --version 4.8.4
tar -zxvf ingress-nginx-4.8.4.tgz
修改values.yaml
loadBalancerIP
为 Metallb 地址池里的IP
controller:
image:
## Keep false as default for now!
registry: registry.cn-hangzhou.aliyuncs.com
image: google_containers/nginx-ingress-controller
# 注释了
# digest: sha256:5b161f051d017e55d358435f295f5e9a297e66158f136321d9b04520ec6c48a3
# digestChroot: sha256:5976b1067cfbca8a21d0ba53d71f83543a73316a61ea7f7e436d6cf84ddf9b26
kind: Deployment
replicaCount: 1
service:
type: LoadBalancer
loadBalancerIP: 192.168.2.149 # 地址为meatllb pool中的地址
admissionWebhooks:
patch:
enabled: true
image:
registry: registry.aliyuncs.com
image: google_containers/kube-webhook-certgen
#digest: sha256:a7943503b45d552785aa3b5e457f169a5661fb94d82b8a3373bcd9ebaf9aac80
安装
helm upgrade --install ingress . -f values.yaml -n kube-system --create-namespace