feat: add LB session persistence and listener idle timeout features#130
feat: add LB session persistence and listener idle timeout features#130mnogueiraops wants to merge 1 commit intooracle:mainfrom
Conversation
- Correct controller-gen marker parsing. - Fix type mismatches with OCI SDK structs. - Update OCI client interface and helper method signatures/calls. - Resolve undefined variable and import errors in controllers. API (api/v1beta1/ingressclassparameters_types.go): - Add lbCookieSessionPersistenceConfiguration and its struct. - Add defaultListenerIdleTimeoutInSeconds. Controllers: - ingressclass.go: handle lbCookieSessionPersistenceConfiguration for default backend set. - ingress.go: apply defaultListenerIdleTimeoutInSeconds to listeners; refactor syncBackendSet for consolidated updates. OCI Client & Helpers: - Update methods in loadbalancer.go to support new parameters. - Extend LoadBalancerInterface and its implementation. Signed-off-by: Marcos Nogueira <mv.victor1@hotmail.com>
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
|
Thank you for signing the OCA. |
|
Any updates on this? I think this would be a significant enhancement as many are starting to weigh alternatives to NGINX ingress controller. |
Seems like Oracle doesn't care with OKE at all. Eternally a BETA. |
|
Sadly, I'm noticing this trend with a few of their open source projects 💔 |
PS: Still waiting for my OCA agreement to be accepted.
Subject: feat: Add LB Cookie Session Persistence and Listener Idle Timeout
Related Issue: Fixes #106 + Add LB side Cookie Session Persistence
Description:
This pull request introduces two significant enhancements to the OCI Native Ingress Controller, allowing finer-grained control over OCI Load Balancer configurations through
IngressClassParameters:lbCookieSessionPersistenceConfigurationfield can now be defined withinIngressClassParameters. This allows users to enable and configure LB cookie stickiness (e.g., cookie name, max-age/timeout, path, domain, security attributes) for backend sets.ingresscontroller now applies this configuration to backend sets created based onIngressrules.ingressclasscontroller also applies this configuration to the default backend set of the Load Balancer.defaultListenerIdleTimeoutInSecondsfield can be specified inIngressClassParameters.ingresscontroller uses this value to configure the idle timeout on listeners (e.g., HTTP, HTTPS) it provisions forIngressresources.Summary of Changes:
api/v1beta1/ingressclassparameters_types.go):lbCookieSessionPersistenceConfiguration(and itsLbCookieSessionPersistenceConfigurationDetailsstruct) toIngressClassParametersSpec.defaultListenerIdleTimeoutInSecondstoIngressClassParametersSpec.pkg/controllers/ingressclass/ingressclass.go: Updated to handlelbCookieSessionPersistenceConfigurationfor the default backend set.pkg/controllers/ingress/ingress.go:defaultListenerIdleTimeoutInSecondsduring listener creation and updates.syncBackendSetto applylbCookieSessionPersistenceConfigurationto Ingress-derived backend sets during creation and updates, ensuring a consolidated update approach.pkg/loadbalancer/loadbalancer.go(CreateListener,UpdateListener,CreateBackendSet,UpdateBackendSet) to support the new parameters.LoadBalancerInterfaceinpkg/oci/client/loadbalancer.go(e.g., addedGetBackendSet) and its implementation.IngressClassParametersYAML (deploy/example/customresource/ingressclassparameter.yaml) has been updated with commented-out sections for the new configurations.Documentation Impact:
README.mdor other documentation detailingIngressClassParametersfields will need to be updated to describelbCookieSessionPersistenceConfigurationanddefaultListenerIdleTimeoutInSeconds.Validation Steps:
Prerequisites:
IngressClassParametersCRD manifest (e.g., usingcontroller-gen crd paths=./api/v1beta1/... output:crd:dir=./deploy/manifests/oci-native-ingress-controller/crds) and apply the updated CRD to your Kubernetes cluster (kubectl apply -f ...). (Already commited with this done)1. Validate LB Cookie Session Persistence:
a. Define an
IngressClassParametersresource with thelbCookieSessionPersistenceConfigurationsection (e.g., setcookieName,timeoutInSeconds).b. Create an
IngressClassreferencing these parameters.c. Deploy an application with an
Ingressusing thisIngressClass.d. Verify in OCI Console: Check the OCI Load Balancer. The backend set corresponding to your Ingress rule should have the specified cookie session persistence settings.
e. Test Stickiness: Make multiple requests from a single client to your application's endpoint. Verify requests are routed to the same backend pod and check for the presence of the configured cookie in HTTP responses.
2. Validate Default Listener Idle Timeout:
a. Define an
IngressClassParametersresource settingdefaultListenerIdleTimeoutInSeconds(e.g., to120).b. Ensure your
IngressClassuses these parameters.c. Deploy an
Ingressthat creates listeners.d. Verify in OCI Console: Check the listeners on the OCI Load Balancer. Their "Idle Timeout" should match the value from
defaultListenerIdleTimeoutInSeconds.