Krumware转发了
Multi-Cluster HA is an interesting topic and can be bit overwhelming for users that are new to k8s. A common problem I see is the how to leverage the GLB for multiple cluster ingress. If you're trying to solve this - I hope this post will help: In this the first problem I like to tackle is giving each cluster an IP or a VIP that floats around. The job of the GLB is to balance clusters NOT nodes. Nodes themselves should be dynamic for autoscaling purposes and should be invisible to the cluster scoped GLB (encapsulation is a good thing :)). A layer 4 loadbalancer to balance the nodes on each cluster to do the trick. You don't need any deticated hardware for this either. Tools like Kube-VIP or MetalLB are free and can solve this exact problem. The next thing is the GLB should be passing traffic with TLS passthrough (L4 mode) but with healthchecks to the /healthz endpoint (either on the ingress or the application itself). The reason for this is because you want encryption down to the cluster - but should be able to failover given a non 200/300 status code - encrypted traffic will be passed through and healthchecks can be async of requests. Keep TLS termination at the cluster level and let ingress rule (or better yet Gateway-API) drive the policy for application access and within the cluster. Use kubernetes native RBAC tooling for controlling traffic access within the cluster. Finally, keep both clusters in sync with GitOps patterns with tools such as ArgoCD or Flux. With this you should have 2+ clusters that are always ready to serve similar applications, that dont expose unencrypted traffic and gives the upstream LB the ability to fail over! Hope this helps someone!