Skip to content

Commit

Permalink
add endpoint pooling to service translation
Browse files Browse the repository at this point in the history
Signed-off-by: Alice-Lilith <[email protected]>
  • Loading branch information
Alice-Lilith committed Jan 30, 2025
1 parent e34d101 commit f43a9d7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/controller/ingress/service_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,15 @@ func (r *ServiceReconciler) buildEndpoints(ctx context.Context, svc *corev1.Serv

internalURL := fmt.Sprintf("tcp://%s.%s.%s.internal:%d", svc.UID, svc.Name, svc.Namespace, port)

// Get whether endpoint pooling should be enabled/disabled from annotations
useEndpointPooling, err := annotations.ExtractUseEndpointPooling(svc)
if err != nil {
log.Error(err, "failed to check endpoints-enabled annotation for service",
"service", fmt.Sprintf("%s.%s", svc.Name, svc.Namespace),
)
return objects, err
}

// The final traffic policy that will be applied to the CloudEndpoint
tp := trafficpolicy.NewTrafficPolicy()

Expand Down Expand Up @@ -476,7 +485,8 @@ func (r *ServiceReconciler) buildEndpoints(ctx context.Context, svc *corev1.Serv
},
},
Spec: ngrokv1alpha1.CloudEndpointSpec{
URL: cloudEndpointURL,
URL: cloudEndpointURL,
PoolingEnabled: useEndpointPooling,
TrafficPolicy: &ngrokv1alpha1.NgrokTrafficPolicySpec{
Policy: rawPolicy,
},
Expand Down

0 comments on commit f43a9d7

Please sign in to comment.