Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication based server side load balancing #1421

Closed
9 tasks done
CarsonCook opened this issue Apr 29, 2021 · 2 comments
Closed
9 tasks done

Authentication based server side load balancing #1421

CarsonCook opened this issue Apr 29, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@CarsonCook
Copy link
Contributor

CarsonCook commented Apr 29, 2021

As a
Zowe conformant application developer
I can
Call my application's API with Zowe authentication through single instance of API Gateway and always get to the same instance of my service for a given period of time.
So that I can
Protect against additional user-related address spaces spawned by my application without changing its code.

This will mean to implement:
A balancing bean that:
Recognizes requests by Zowe authentication - User level. User has multiple JWT's so we have to understand who is calling.
Unauthenticated requests? - Per Carson's response, unauthenticated requests should be plain round robin
If there is auth and no preference, routes the request to round robin and stores preference.
If there is auth and exists preference, routes the requests to the same instanceId as the preference
Lifecycle: Expiry of preference after configurable time period is exceeded since last request

Tasks

  • Create AuthenticationBasedPredicate predicate within org.zowe.apiml.gateway.ribbon.loadbalancer.predicate package - @balhar-jakub
  • Create a new PostStoreLoadBalancerCacheFilter that stores the information about the selected instance if the service is configured to keep this information. - @taban03
  • Update AuthenticationBasedPredicate to support expiration date - @taban03
  • Update org.zowe.apiml.gateway.ribbon.loadbalancer.LoadBalancingPredicatesRibbonConfig to create the predicate if enabled via instance.metadata.apiml.lb.authenticateBased=enabled - @balhar-jakub
  • Update org.zowe.apiml.gateway.routing.ApimlRoutingConfig to conditionally create PostStoreLoadBalancerCacheFilter if enabled via instance.metadata.apiml.lb.authenticateBased=enabled - @taban03
  • Create LoadBalancerCache in org.zowe.apiml.gateway.cache exposing methods to store combination of username, serviceId and userId - @balhar-jakub
  • Create functional test for the whole solution - @balhar-jakub
  • Create documentation - @taban03 (waiting for review)

Acceptance Criteria

  • When authenticated I end on the same southbound instance if required by service
@CarsonCook CarsonCook added enhancement New feature or request new New issue that has not been worked on yet labels Apr 29, 2021
@balhar-jakub balhar-jakub added 21PI2 and removed new New issue that has not been worked on yet labels Apr 29, 2021
@jandadav jandadav changed the title Add instance user limits for deterministic routing Authentication based server side load balancing Jun 3, 2021
@anton-brezina anton-brezina added this to the 21PI2S4 milestone Jun 16, 2021
@balhar-jakub
Copy link
Member

AuthenticationBasedPredicate - Figures out whether a user is authenticated. If the user is authenticated look for an instance to use. If there is such an instance, verify whether it's not in the cache for too long. If it isn't verify that this is the selected instance.

PostStoreLoadBalancerCacheFilter - Looks whether the service requires a sticky session. Figures out whether the user is authenticated. If the user is authenticated and there is no instance in the cache stores the selected instance in the cache.

LoadBalancerCache - Provide a method to store instance info and retrieve the instance info.

@balhar-jakub balhar-jakub self-assigned this Jun 24, 2021
@jandadav
Copy link
Contributor

jandadav commented Jun 28, 2021

The concept of this implementation looks like this:
IMG_20210628_101104.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants