Comments (2)
Overview
Dataplane CRs like APIs, HttpRoutes and Policies are stored in the etcd key value storage in the Kubernetes API server. The main goal of this APK Agent is to reconcile the Dataplane CRs, validate and configure the corresponding Choreo connect router instance through xDS.
Design
Controller go routine contains the controllers for the CRs like API, HttpRoute, Policy and runs reconcile loops based on the state of the cache and Kubernetes API server state.
APIController is the parent controller and watches for any changes happening to APIs and HttpRoutes.
HttpRouteController watches for HttpRoutes, Backends (Services) and Policies.
PolicyController watches for Policies.
Reconciliation sequence propagates upwards from the child controller. For example if a policy gets changed it will trigger the HttpRouteController and reconcile the related HttpRoute. This change to the HttpRoute will trigger the APIController and it will process the API reconciliation based on the data stored in the intermediate data store and Kubernetes operator cache.
APIController is the parent controller and it should be made intelligent to detect the related API events and pass the event through the channel to the synchronizer go routine.
Events passed from the APIController to the synchronizer will be of the following types.
-
CREATE
API CR CREATE -
UPDATE
API CR UPDATE
HttpRoute CR CREATE
HttpRoute CR UPDATE
HttpRoute CR DELETE
Policy CR CREATE
Policy CR UPDATE
Policy CR DELETE -
DELETE
API CR DELETE
Intermediate storage
To save the intermediate representation we need to have thread safe hashmaps. For that we can use,
Locks / Mutex (Pessimistic concurrency control)
CAS - Compare and Swap (Optimistic concurrency control)
type API struct {
APIDefinition *v1alpha1.API
HttpRoutes []*gwapiv1b1.HTTPRoute
APIPolicies []*v1alpha1.Policy
}
Channel / Buffered channel
We can use a channel or a buffered channel depending on the frequency of message passing. In this case consumer (synchronizer) may take more time to process so a buffered channel is preferred to prevent the producer (controller) getting blocked.
Reconcile Loop
Reconcile loop breaks depending on the state of the intermediate storage and the K8s controller cache.
from apk.
closing as the operator has been implemented according to the above design
from apk.
Related Issues (20)
- Ratelimit Policy Update from Admin portal doesn't work properly in CP to DP flow
- Add API Key to agent implementation
- [DP to CP] adding api key crashed adapter HOT 1
- Need to Template Resources, Service Account for Agent deployment in Agent Helm Chart
- Cannot disable cors in CR
- Update API Key implementation in Config Deployer
- Rate limiting doesn't get properly configured in DP when switching from API Level to Resource Level
- Implement GQL APIs with CRs
- gql endpoint with empty basepath does not work
- Unable to attach different scopes for different resources using config ds
- Need to add documentation related to setting APK as a gateway in APIM in APIM docs
- gRPC support for APK
- Need to add deployment Patterns for CP to DP and DP to CP flow and Refactor Control Plane docs
- oAuth2 disabled configuration not properly mapped in the APK-Conf generation flow
- Issue with status in API CRs
- There is Limitation in features of control plane! I Suggest remove limits! HOT 2
- Code redundancy in agent-integration tests
- Proto parser has limitations (feature/grpc branch)
- API deployment not working (APIM 4.3.0 as control plan) HOT 2
- APIM 4.3.0 locally DP runs K8s Rancher and mixing up subscription information HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apk.