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)
- Support Prometheus
- Adapter crashed when Analytics (Choreo and ELK) is enabled
- [Migration] Forward port apk-conf related extractor and transformer changes to 4.2.0
- Containers crashed while logs are enabled
- Backend Timeout Error Code Mismatch HOT 1
- Ability to run the gateway as a edge gateway (443 port) HOT 1
- Response interceptor configurations does not work properly for response headers HOT 1
- accessControlExposeHeaders CORS configuration is not allowed through apk-conf deployment
- Fix helm chart to support partitions
- Adapter crashed
- Error when interceptor backend has a tls certs
- Congif Namespace in CC
- Need to update all WSO2 license headers to LLC
- Exception error log in Enforcer
- Policy Execution order should be specific via policy attachment levels HOT 1
- Throttle out responses does not return any response HOT 1
- Error encountered while invoking composite API HOT 1
- Received the 504 Gateway Time-out error intermittently HOT 1
- Custom Authentication header not working HOT 2
- [Rate Limiting Feature] Not getting a Message when throttled out HOT 2
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.