By reading the dubbo source code, it is found that there are two main functions to be provided to better complete the adaptation
Watch monitoring mechanism
GetRule to get full configuration at one time
A client is implemented. The Java version of the client only needs to be reproduced against this client. The push has high performance requirements, so grpc connection multiplexing is encapsulated on the client side.
Both functions are implemented in this PR
Performance
The push process uses grpc bidirectional stream + connection multiplexing, similar to etcd, with very high performance.
design concept
The configuration is not stored and pushed directly in the memory. GetRule also temporarily stores the configuration in memory without persistent storage.
design
Refer to the design method of etcd related functions
Possible problems
If one pod of dubbo is added, where does the traffic rule come from? You can get the full amount of rules with GetRule first, and then use Watch to monitor, so it doesn’t matter if you add pods.
In order to solve this pain point, combined with special business needs, the leaderElect mechanism of the operator is not used, so that each instance will simultaneously monitor the changes of cr resources and perform corresponding processing at the same time, thus ensuring idempotency. At the same time, the consistency of saving the configuration to memory is also guaranteed
Traffic control adaptation k8s
Provide functionality
By reading the dubbo source code, it is found that there are two main functions to be provided to better complete the adaptation
A client is implemented. The Java version of the client only needs to be reproduced against this client. The push has high performance requirements, so grpc connection multiplexing is encapsulated on the client side.
Both functions are implemented in this PR
Performance
The push process uses grpc bidirectional stream + connection multiplexing, similar to etcd, with very high performance.
design concept
The configuration is not stored and pushed directly in the memory. GetRule also temporarily stores the configuration in memory without persistent storage.
design
Refer to the design method of etcd related functions
Possible problems