Skip to content

Commit

Permalink
change ingressClassName & support another backend namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
backguynn committed Aug 7, 2024
1 parent fc92249 commit 1cc43f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/agent/manager/gatewayapi/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (h *HTTPRouteManager) createIngress(ctx context.Context, httpRoute *v1.HTTP
newIngress.SetLabels(map[string]string{
"implementation": implementation,
})
ingressClass := "loxilb.io/loxilb"
ingressClass := "loxilb"
newIngress.Spec.IngressClassName = &ingressClass

// If the listener has a hostname, it takes precedence over httpRoute.
Expand Down Expand Up @@ -327,6 +327,13 @@ func (h *HTTPRouteManager) createIngress(ctx context.Context, httpRoute *v1.HTTP
for _, match := range rule.Matches {
for _, backref := range rule.BackendRefs {

if backref.Namespace != nil {
if newIngress.Namespace != string(*backref.Namespace) {
newIngress.Annotations["external-backend-service"] = "true"
newIngress.Annotations["service-"+string(backref.Name)+"-namespace"] = string(*backref.Namespace)
}
}

newIngressPath := netv1.HTTPIngressPath{
Backend: netv1.IngressBackend{
Service: &netv1.IngressServiceBackend{
Expand Down

0 comments on commit 1cc43f7

Please sign in to comment.