From b1dfb8e236ad87ab5dac6a1cc513e95ec3bb68cf Mon Sep 17 00:00:00 2001 From: yangkaa <30614084+yangkaa@users.noreply.github.com> Date: Thu, 12 Dec 2024 00:02:19 +0800 Subject: [PATCH] fix: multi rbd-hub build error (#268) Signed-off-by: yangk --- controllers/handler/hub.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/controllers/handler/hub.go b/controllers/handler/hub.go index fef21521..f4627fd7 100644 --- a/controllers/handler/hub.go +++ b/controllers/handler/hub.go @@ -138,8 +138,9 @@ func (h *hub) ingressForHub() client.Object { }, Backends: []v2.ApisixRouteHTTPBackend{ { - ServicePort: intstr.FromInt(5000), - ServiceName: "rbd-hub", + ServicePort: intstr.FromInt(5000), + ServiceName: "rbd-hub", + ResolveGranularity: "service", }, }, Authentication: v2.ApisixRouteAuthentication{ @@ -393,7 +394,13 @@ func (h *hub) serviceForHub() client.Object { }, }, }, - Selector: h.labels, + Selector: h.labels, + SessionAffinity: corev1.ServiceAffinityClientIP, + SessionAffinityConfig: &corev1.SessionAffinityConfig{ + ClientIP: &corev1.ClientIPConfig{ + TimeoutSeconds: commonutil.Int32(600), + }, + }, }, }