我已经在数字海洋水滴上部署了一个 Kubernetes 集群(使用 kubeadm)。我使用 helm chart 安装了 HAProxy(如他们的博客https://www.haproxy.com/blog/use-helm-to-install-the-haproxy-kubernetes-ingress-controller/中所建议的)
helm install haproxy haproxytech/kubernetes-ingress \
--set controller.kind=DaemonSet
--set controller.daemonset.useHostPort=true
--set controller.daemonset.useHostNetwork=true
--set controller.service.type=LoadBalancer
--set-string "controller.config.ssl-redirect=true"
我通过将 Ingress 类设置为“haproxy”将我的入口指向 HAProxy
kind: Ingress
metadata:
name: ****-ingress
annotations:
# nginx.ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.class: haproxy
cert-manager.io/cluster-issuer: ****-issuer
spec:
tls:
- hosts:
- <my-custom-domain>
secretName: *****
rules:
- host: <my-custom-domain>
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: frontend
port:
number: 80
- path: /api
pathType: Prefix
backend:
service:
name: backend
port:
number: 8000
问题是 haproxy 负载均衡器需要永远创建一个外部 ip 我从 pod 中发现的唯一错误是:
这里出了什么问题?!提前致谢 !