-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Extension kubernetes registry #1395
Extension kubernetes registry #1395
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1395 +/- ##
============================================
- Coverage 72.02% 72.00% -0.03%
Complexity 791 791
============================================
Files 422 422
Lines 17813 17816 +3
Branches 2769 2769
============================================
- Hits 12830 12828 -2
- Misses 3568 3570 +2
- Partials 1415 1418 +3 ☔ View full report in Codecov by Sentry. |
Looks interesting. Would you please briefly describe the behavior of the register and unRegister? It seems the information is written to the pod's annotation and label? |
sure, I will add the doc on this feature |
related sofastack/sofa-boot#1289 |
朱立焕收到,谢谢
|
core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java
Outdated
Show resolved
Hide resolved
...rnetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/util/KubernetesClientUtils.java
Outdated
Show resolved
Hide resolved
...rnetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/util/KubernetesConfigUtils.java
Outdated
Show resolved
Hide resolved
...bernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java
Show resolved
Hide resolved
...src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java
Outdated
Show resolved
Hide resolved
...try-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
Show resolved
Hide resolved
...try-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
Show resolved
Hide resolved
...bernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java
Outdated
Show resolved
Hide resolved
...kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java
Outdated
Show resolved
Hide resolved
...try-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
Outdated
Show resolved
Hide resolved
d2c502e
to
af2a8c4
Compare
core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java
Outdated
Show resolved
Hide resolved
core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java
Outdated
Show resolved
Hide resolved
...try-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
Outdated
Show resolved
Hide resolved
...try-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
Outdated
Show resolved
Hide resolved
WalkthroughThe update introduces a Kubernetes registry to the SOFA RPC framework, enhancing service discovery and registration within Kubernetes environments. It adds support for configuring Kubernetes client settings, converting Kubernetes pods to provider information, and managing service provider updates based on pod changes. Additionally, it includes testing functionality for these new features, ensuring reliability and performance in Kubernetes deployments. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 7
Configuration used: CodeRabbit UI
Files ignored due to path filters (6)
all/pom.xml
is excluded by:!**/*.xml
bom/pom.xml
is excluded by:!**/*.xml
registry/pom.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/pom.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/src/test/resources/log4j.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/src/test/resources/sofa-rpc/rpc-config.json
is excluded by:!**/*.json
Files selected for processing (14)
- core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/constant/KubernetesClientConstants.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesClientUtils.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesConfigUtils.java (1 hunks)
- registry/registry-kubernetes/src/main/resources/META-INF/services/sofa-rpc/com.alipay.sofa.rpc.registry.Registry (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService2.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl2.java (1 hunks)
- registry/registry-kubernetes/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker (1 hunks)
Files skipped from review due to trivial changes (3)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/constant/KubernetesClientConstants.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService.java
- registry/registry-kubernetes/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
Additional comments: 10
registry/registry-kubernetes/src/main/resources/META-INF/services/sofa-rpc/com.alipay.sofa.rpc.registry.Registry (1)
- 1-1: The service provider configuration correctly maps the
kubernetes
key to theKubernetesRegistry
implementation. This is essential for the SOFA RPC framework to discover and use the Kubernetes registry at runtime.registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService2.java (1)
- 1-22: The
TestService2
interface is correctly defined and follows Java conventions. It provides a clear contract for a test service, which is essential for testing the Kubernetes registry functionality.registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl.java (1)
- 1-25: The
TestServiceImpl
class is correctly implemented, adhering to theTestService
interface. It provides a straightforward implementation of thesayHello
method, suitable for testing purposes.registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl2.java (1)
- 1-25: The
TestServiceImpl2
class is correctly implemented, adhering to theTestService2
interface. It provides a straightforward implementation of thesayHello
method, suitable for testing purposes.registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesClientUtils.java (1)
- 1-28: The
KubernetesClientUtils
class provides a crucial utility methodbuildKubernetesClient
for creating Kubernetes clients with the provided configuration. This is essential for the Kubernetes registry functionality within the SOFA RPC framework.registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java (1)
- 1-78: The
KubernetesRegistryProviderWatcher
class is well-implemented, providing functionality to manage provider listeners and update providers based on Kubernetes pod information. This is crucial for the dynamic nature of service discovery in Kubernetes environments.registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java (1)
- 1-113: The
KubernetesRegistryHelper
class is well-implemented, offering essential functionality for converting Kubernetes pod information intoProviderInfo
instances for service discovery. This plays a critical role in integrating the SOFA RPC framework with Kubernetes environments.registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesConfigUtils.java (1)
- 1-104: The
KubernetesConfigUtils
class provides essential functionality for creating Kubernetes configurations based on registry settings. This is crucial for the seamless integration of the SOFA RPC framework with Kubernetes environments.core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java (1)
- 427-428: The boolean
getParameter
method is correctly implemented and follows best practices by directly parsing the boolean value from the parameters map. This method is straightforward and does not require further refinement.registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java (1)
- 319-351: The
testUpdatePodAnnotations
test case is well-structured and covers the functionality of updating pod annotations. It correctly creates a pod, updates its annotations, and asserts the changes. This test case follows best practices for unit testing and effectively validates the intended behavior.
// init kubernetes config | ||
Config config = KubernetesConfigUtils.buildKubernetesConfig(registryConfig); | ||
// init kubernetes client | ||
if (kubernetesClient == null) { | ||
this.kubernetesClient = KubernetesClientUtils.buildKubernetesClient(config); | ||
} | ||
// init Watcher | ||
if (kubernetesRegistryProviderWatcher == null) { | ||
kubernetesRegistryProviderWatcher = new KubernetesRegistryProviderWatcher(); | ||
} | ||
this.currentHostname = System.getenv("HOSTNAME"); | ||
this.namespace = config.getNamespace(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialization of Config
and KubernetesClient
in the init
method does not handle potential exceptions that might be thrown during the client's creation or configuration setup. It's important to ensure that any issues during initialization are properly logged or handled to avoid runtime failures.
Consider wrapping the client and config initialization code in a try-catch block to handle potential exceptions, logging any errors encountered during the process.
public void register(ProviderConfig config) { | ||
String appName = config.getAppName(); | ||
if (!registryConfig.isRegister()) { | ||
if (LOGGER.isInfoEnabled(appName)) { | ||
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | ||
} | ||
return; | ||
} | ||
|
||
if (config.isRegister()) { | ||
PodResource podResource = kubernetesClient.pods() | ||
.inNamespace(namespace) | ||
.withName(currentHostname); | ||
|
||
List<ServerConfig> serverConfigs = config.getServer(); | ||
|
||
if (CommonUtils.isNotEmpty(serverConfigs)) { | ||
for (ServerConfig serverConfig : serverConfigs) { | ||
String dataId = KubernetesRegistryHelper.buildDataId(config, serverConfig.getProtocol()); | ||
providerInstances.put(dataId, config); | ||
|
||
podResource.edit(pod -> new PodBuilder(pod).editOrNewMetadata() | ||
// 将ProviderConfig存在Annotations上 | ||
.addToAnnotations(dataId, JSON.toJSONString(config, true)) | ||
.endMetadata().build()); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The register
method directly modifies pod annotations to store ProviderConfig
information. This approach tightly couples the service registration logic with the Kubernetes pod annotations, which might not be ideal for all deployment scenarios. Additionally, there's no error handling for the Kubernetes client operations, which could lead to silent failures.
Consider abstracting the storage mechanism for ProviderConfig
and adding error handling for Kubernetes client operations to ensure robustness and flexibility.
+ try {
+ podResource.edit(pod -> new PodBuilder(pod).editOrNewMetadata()
+ .addToAnnotations(dataId, JSON.toJSONString(config, true))
+ .endMetadata().build());
+ } catch (Exception e) {
+ LOGGER.error("Error registering provider config", e);
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public void register(ProviderConfig config) { | |
String appName = config.getAppName(); | |
if (!registryConfig.isRegister()) { | |
if (LOGGER.isInfoEnabled(appName)) { | |
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | |
} | |
return; | |
} | |
if (config.isRegister()) { | |
PodResource podResource = kubernetesClient.pods() | |
.inNamespace(namespace) | |
.withName(currentHostname); | |
List<ServerConfig> serverConfigs = config.getServer(); | |
if (CommonUtils.isNotEmpty(serverConfigs)) { | |
for (ServerConfig serverConfig : serverConfigs) { | |
String dataId = KubernetesRegistryHelper.buildDataId(config, serverConfig.getProtocol()); | |
providerInstances.put(dataId, config); | |
podResource.edit(pod -> new PodBuilder(pod).editOrNewMetadata() | |
// 将ProviderConfig存在Annotations上 | |
.addToAnnotations(dataId, JSON.toJSONString(config, true)) | |
.endMetadata().build()); | |
} | |
} | |
} | |
public void register(ProviderConfig config) { | |
String appName = config.getAppName(); | |
if (!registryConfig.isRegister()) { | |
if (LOGGER.isInfoEnabled(appName)) { | |
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | |
} | |
return; | |
} | |
if (config.isRegister()) { | |
PodResource podResource = kubernetesClient.pods() | |
.inNamespace(namespace) | |
.withName(currentHostname); | |
List<ServerConfig> serverConfigs = config.getServer(); | |
if (CommonUtils.isNotEmpty(serverConfigs)) { | |
for (ServerConfig serverConfig : serverConfigs) { | |
String dataId = KubernetesRegistryHelper.buildDataId(config, serverConfig.getProtocol()); | |
providerInstances.put(dataId, config); | |
try { | |
podResource.edit(pod -> new PodBuilder(pod).editOrNewMetadata() | |
// 将ProviderConfig存在Annotations上 | |
.addToAnnotations(dataId, JSON.toJSONString(config, true)) | |
.endMetadata().build()); | |
} catch (Exception e) { | |
LOGGER.error("Error registering provider config", e); | |
} | |
} | |
} | |
} |
public void unRegister(ProviderConfig config) { | ||
String appName = config.getAppName(); | ||
if (!registryConfig.isRegister()) { | ||
if (LOGGER.isInfoEnabled(appName)) { | ||
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | ||
} | ||
return; | ||
} | ||
|
||
if (config.isRegister()) { | ||
PodResource podResource = kubernetesClient.pods() | ||
.inNamespace(namespace) | ||
.withName(currentHostname); | ||
|
||
List<ServerConfig> serverConfigs = config.getServer(); | ||
if (CommonUtils.isNotEmpty(serverConfigs)) { | ||
for (ServerConfig serverConfig : serverConfigs) { | ||
String dataId = KubernetesRegistryHelper.buildDataId(config, serverConfig.getProtocol()); | ||
providerInstances.remove(dataId); | ||
|
||
podResource.edit(pod -> new PodBuilder(pod).editOrNewMetadata() | ||
.removeFromAnnotations(dataId) | ||
.endMetadata() | ||
.build()); | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the register
method, unRegister
also directly interacts with pod annotations without error handling. This could lead to issues if the Kubernetes client operations fail.
Implement error handling for Kubernetes client operations in the unRegister
method to ensure reliability.
+ try {
+ podResource.edit(pod -> new PodBuilder(pod).editOrNewMetadata()
+ .removeFromAnnotations(dataId)
+ .endMetadata()
+ .build());
+ } catch (Exception e) {
+ LOGGER.error("Error unregistering provider config", e);
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public void unRegister(ProviderConfig config) { | |
String appName = config.getAppName(); | |
if (!registryConfig.isRegister()) { | |
if (LOGGER.isInfoEnabled(appName)) { | |
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | |
} | |
return; | |
} | |
if (config.isRegister()) { | |
PodResource podResource = kubernetesClient.pods() | |
.inNamespace(namespace) | |
.withName(currentHostname); | |
List<ServerConfig> serverConfigs = config.getServer(); | |
if (CommonUtils.isNotEmpty(serverConfigs)) { | |
for (ServerConfig serverConfig : serverConfigs) { | |
String dataId = KubernetesRegistryHelper.buildDataId(config, serverConfig.getProtocol()); | |
providerInstances.remove(dataId); | |
podResource.edit(pod -> new PodBuilder(pod).editOrNewMetadata() | |
.removeFromAnnotations(dataId) | |
.endMetadata() | |
.build()); | |
} | |
} | |
} | |
} | |
public void unRegister(ProviderConfig config) { | |
String appName = config.getAppName(); | |
if (!registryConfig.isRegister()) { | |
if (LOGGER.isInfoEnabled(appName)) { | |
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | |
} | |
return; | |
} | |
if (config.isRegister()) { | |
PodResource podResource = kubernetesClient.pods() | |
.inNamespace(namespace) | |
.withName(currentHostname); | |
List<ServerConfig> serverConfigs = config.getServer(); | |
if (CommonUtils.isNotEmpty(serverConfigs)) { | |
for (ServerConfig serverConfig : serverConfigs) { | |
String dataId = KubernetesRegistryHelper.buildDataId(config, serverConfig.getProtocol()); | |
providerInstances.remove(dataId); | |
try { | |
podResource.edit(pod -> new PodBuilder(pod).editOrNewMetadata() | |
.removeFromAnnotations(dataId) | |
.endMetadata() | |
.build()); | |
} catch (Exception e) { | |
LOGGER.error("Error unregistering provider config", e); | |
} | |
} | |
} | |
} | |
} |
public List<ProviderGroup> subscribe(ConsumerConfig config) { | ||
String appName = config.getAppName(); | ||
if (!registryConfig.isSubscribe()) { | ||
// registry ignored | ||
if (LOGGER.isInfoEnabled(appName)) { | ||
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | ||
} | ||
return null; | ||
} | ||
|
||
if (config.isSubscribe()) { | ||
|
||
ProviderInfoListener providerInfoListener = config.getProviderInfoListener(); | ||
kubernetesRegistryProviderWatcher.addProviderListener(config, providerInfoListener); | ||
|
||
FilterWatchListDeletable<Pod, PodList, PodResource> podPodListPodResourceFilterWatchListDeletable = | ||
kubernetesClient.pods() | ||
.inNamespace(namespace); | ||
|
||
SharedIndexInformer<Pod> inform = podPodListPodResourceFilterWatchListDeletable.inform(new ResourceEventHandler<Pod>() { | ||
@Override | ||
public void onAdd(Pod pod) { | ||
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | ||
} | ||
|
||
@Override | ||
public void onUpdate(Pod pod, Pod t1) { | ||
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | ||
} | ||
|
||
@Override | ||
public void onDelete(Pod pod, boolean b) { | ||
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | ||
} | ||
}); | ||
|
||
consumerListeners.put(config, inform); | ||
|
||
inform.start(); | ||
|
||
List<Pod> pods = podPodListPodResourceFilterWatchListDeletable.list().getItems(); | ||
List<ProviderInfo> providerInfos = KubernetesRegistryHelper.convertPodsToProviders(pods, config); | ||
List<ProviderInfo> matchProviders = RegistryUtils.matchProviderInfos(config, providerInfos); | ||
|
||
return Collections.singletonList(new ProviderGroup().addAll(matchProviders)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subscribe
method lacks error handling for Kubernetes client operations and does not validate the returned pod list before converting it to provider infos. This could lead to unexpected behavior if the pod list is null or the Kubernetes client operations fail.
Add error handling and validation for the pod list in the subscribe
method to ensure stability and correctness.
+ try {
+ List<Pod> pods = podPodListPodResourceFilterWatchListDeletable.list().getItems();
+ if (pods != null) {
+ List<ProviderInfo> providerInfos = KubernetesRegistryHelper.convertPodsToProviders(pods, config);
+ List<ProviderInfo> matchProviders = RegistryUtils.matchProviderInfos(config, providerInfos);
+ return Collections.singletonList(new ProviderGroup().addAll(matchProviders));
+ } else {
+ LOGGER.warn("No pods found for subscription");
+ return Collections.emptyList();
+ }
+ } catch (Exception e) {
+ LOGGER.error("Error subscribing to provider infos", e);
+ return Collections.emptyList();
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public List<ProviderGroup> subscribe(ConsumerConfig config) { | |
String appName = config.getAppName(); | |
if (!registryConfig.isSubscribe()) { | |
// registry ignored | |
if (LOGGER.isInfoEnabled(appName)) { | |
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | |
} | |
return null; | |
} | |
if (config.isSubscribe()) { | |
ProviderInfoListener providerInfoListener = config.getProviderInfoListener(); | |
kubernetesRegistryProviderWatcher.addProviderListener(config, providerInfoListener); | |
FilterWatchListDeletable<Pod, PodList, PodResource> podPodListPodResourceFilterWatchListDeletable = | |
kubernetesClient.pods() | |
.inNamespace(namespace); | |
SharedIndexInformer<Pod> inform = podPodListPodResourceFilterWatchListDeletable.inform(new ResourceEventHandler<Pod>() { | |
@Override | |
public void onAdd(Pod pod) { | |
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | |
} | |
@Override | |
public void onUpdate(Pod pod, Pod t1) { | |
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | |
} | |
@Override | |
public void onDelete(Pod pod, boolean b) { | |
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | |
} | |
}); | |
consumerListeners.put(config, inform); | |
inform.start(); | |
List<Pod> pods = podPodListPodResourceFilterWatchListDeletable.list().getItems(); | |
List<ProviderInfo> providerInfos = KubernetesRegistryHelper.convertPodsToProviders(pods, config); | |
List<ProviderInfo> matchProviders = RegistryUtils.matchProviderInfos(config, providerInfos); | |
return Collections.singletonList(new ProviderGroup().addAll(matchProviders)); | |
} | |
public List<ProviderGroup> subscribe(ConsumerConfig config) { | |
String appName = config.getAppName(); | |
if (!registryConfig.isSubscribe()) { | |
// registry ignored | |
if (LOGGER.isInfoEnabled(appName)) { | |
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE)); | |
} | |
return null; | |
} | |
if (config.isSubscribe()) { | |
ProviderInfoListener providerInfoListener = config.getProviderInfoListener(); | |
kubernetesRegistryProviderWatcher.addProviderListener(config, providerInfoListener); | |
FilterWatchListDeletable<Pod, PodList, PodResource> podPodListPodResourceFilterWatchListDeletable = | |
kubernetesClient.pods() | |
.inNamespace(namespace); | |
SharedIndexInformer<Pod> inform = podPodListPodResourceFilterWatchListDeletable.inform(new ResourceEventHandler<Pod>() { | |
@Override | |
public void onAdd(Pod pod) { | |
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | |
} | |
@Override | |
public void onUpdate(Pod pod, Pod t1) { | |
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | |
} | |
@Override | |
public void onDelete(Pod pod, boolean b) { | |
kubernetesRegistryProviderWatcher.updateProviders(config, getPods()); | |
} | |
}); | |
consumerListeners.put(config, inform); | |
inform.start(); | |
try { | |
List<Pod> pods = podPodListPodResourceFilterWatchListDeletable.list().getItems(); | |
if (pods != null) { | |
List<ProviderInfo> providerInfos = KubernetesRegistryHelper.convertPodsToProviders(pods, config); | |
List<ProviderInfo> matchProviders = RegistryUtils.matchProviderInfos(config, providerInfos); | |
return Collections.singletonList(new ProviderGroup().addAll(matchProviders)); | |
} else { | |
LOGGER.warn("No pods found for subscription"); | |
return Collections.emptyList(); | |
} | |
} catch (Exception e) { | |
LOGGER.error("Error subscribing to provider infos", e); | |
return Collections.emptyList(); | |
} | |
} |
public void unSubscribe(ConsumerConfig config) { | ||
if (config.isSubscribe()) { | ||
SharedIndexInformer<Pod> informer = consumerListeners.remove(config); | ||
if (null != informer) { | ||
informer.stop(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unSubscribe
method does not log or handle potential exceptions that might occur during the informer's stop operation. This could lead to silent failures in unsubscribing from provider updates.
Add error handling for the informer's stop operation in the unSubscribe
method to ensure clean resource management.
+ try {
+ if (null != informer) {
+ informer.stop();
+ }
+ } catch (Exception e) {
+ LOGGER.error("Error stopping informer for consumer config", e);
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public void unSubscribe(ConsumerConfig config) { | |
if (config.isSubscribe()) { | |
SharedIndexInformer<Pod> informer = consumerListeners.remove(config); | |
if (null != informer) { | |
informer.stop(); | |
} | |
} | |
public void unSubscribe(ConsumerConfig config) { | |
if (config.isSubscribe()) { | |
SharedIndexInformer<Pod> informer = consumerListeners.remove(config); | |
try { | |
if (null != informer) { | |
informer.stop(); | |
} | |
} catch (Exception e) { | |
LOGGER.error("Error stopping informer for consumer config", e); | |
} | |
} |
/** | ||
* Gets parameter or default. | ||
* | ||
* @param key the key | ||
* @return the value | ||
*/ | ||
public String getParameter(String key, String defaultValue) { | ||
return getParameter(key) == null ? defaultValue : getParameter(key); | ||
} | ||
|
||
/** | ||
* Gets parameter or default. | ||
* | ||
* @param key the key | ||
* @return the value | ||
*/ | ||
public int getParameter(String key, int defaultValue) { | ||
return getParameter(key) == null ? defaultValue : Integer.parseInt(parameters.get(key)); | ||
} | ||
|
||
/** | ||
* Gets parameter or default. | ||
* | ||
* @param key the key | ||
* @return the value | ||
*/ | ||
public boolean getParameter(String key, boolean defaultValue) { | ||
return getParameter(key) == null ? defaultValue : Boolean.parseBoolean(parameters.get(key)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newly added getParameter
overloaded methods provide a convenient way to retrieve parameters with default values. However, there's a potential performance issue with the string-based getParameter
method due to calling getParameter(key)
twice.
Optimize the string-based getParameter
method to avoid redundant map lookups.
- return getParameter(key) == null ? defaultValue : getParameter(key);
+ String value = getParameter(key);
+ return value == null ? defaultValue : value;
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
/** | |
* Gets parameter or default. | |
* | |
* @param key the key | |
* @return the value | |
*/ | |
public String getParameter(String key, String defaultValue) { | |
return getParameter(key) == null ? defaultValue : getParameter(key); | |
} | |
/** | |
* Gets parameter or default. | |
* | |
* @param key the key | |
* @return the value | |
*/ | |
public int getParameter(String key, int defaultValue) { | |
return getParameter(key) == null ? defaultValue : Integer.parseInt(parameters.get(key)); | |
} | |
/** | |
* Gets parameter or default. | |
* | |
* @param key the key | |
* @return the value | |
*/ | |
public boolean getParameter(String key, boolean defaultValue) { | |
return getParameter(key) == null ? defaultValue : Boolean.parseBoolean(parameters.get(key)); | |
} | |
/** | |
* Gets parameter or default. | |
* | |
* @param key the key | |
* @return the value | |
*/ | |
public String getParameter(String key, String defaultValue) { | |
String value = getParameter(key); | |
return value == null ? defaultValue : value; | |
} | |
/** | |
* Gets parameter or default. | |
* | |
* @param key the key | |
* @return the value | |
*/ | |
public int getParameter(String key, int defaultValue) { | |
return getParameter(key) == null ? defaultValue : Integer.parseInt(parameters.get(key)); | |
} | |
/** | |
* Gets parameter or default. | |
* | |
* @param key the key | |
* @return the value | |
*/ | |
public boolean getParameter(String key, boolean defaultValue) { | |
return getParameter(key) == null ? defaultValue : Boolean.parseBoolean(parameters.get(key)); | |
} |
public int getParameter(String key, int defaultValue) { | ||
return getParameter(key) == null ? defaultValue : Integer.parseInt(parameters.get(key)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the getParameter
method that returns an int
, there's a potential NumberFormatException
if the parameter value is not a valid integer. This could lead to runtime exceptions when invalid data is present.
Add error handling for parsing integers to prevent NumberFormatException
.
+ try {
+ return getParameter(key) == null ? defaultValue : Integer.parseInt(parameters.get(key));
+ } catch (NumberFormatException e) {
+ LOGGER.warn("Invalid integer parameter value for key: " + key, e);
+ return defaultValue;
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
public int getParameter(String key, int defaultValue) { | |
return getParameter(key) == null ? defaultValue : Integer.parseInt(parameters.get(key)); | |
public int getParameter(String key, int defaultValue) { | |
try { | |
return getParameter(key) == null ? defaultValue : Integer.parseInt(parameters.get(key)); | |
} catch (NumberFormatException e) { | |
LOGGER.warn("Invalid integer parameter value for key: " + key, e); | |
return defaultValue; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java
1db382c
to
49349b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (7)
all/pom.xml
is excluded by:!**/*.xml
bom/pom.xml
is excluded by:!**/*.xml
pom.xml
is excluded by:!**/*.xml
registry/pom.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/pom.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/src/test/resources/log4j.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/src/test/resources/sofa-rpc/rpc-config.json
is excluded by:!**/*.json
Files selected for processing (18)
- core/api/src/main/java/com/alipay/sofa/rpc/common/Version.java (1 hunks)
- core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java (1 hunks)
- core/api/src/main/java/com/alipay/sofa/rpc/config/UserThreadPoolManager.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/constant/KubernetesClientConstants.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesClientUtils.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesConfigUtils.java (1 hunks)
- registry/registry-kubernetes/src/main/resources/META-INF/services/sofa-rpc/com.alipay.sofa.rpc.registry.Registry (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService2.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl2.java (1 hunks)
- registry/registry-kubernetes/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker (1 hunks)
- registry/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistry.java (4 hunks)
- registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryTest.java (8 hunks)
Files skipped from review due to trivial changes (1)
- core/api/src/main/java/com/alipay/sofa/rpc/common/Version.java
Files skipped from review as they are similar to previous changes (14)
- core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/constant/KubernetesClientConstants.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesClientUtils.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesConfigUtils.java
- registry/registry-kubernetes/src/main/resources/META-INF/services/sofa-rpc/com.alipay.sofa.rpc.registry.Registry
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService2.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl2.java
- registry/registry-kubernetes/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
Additional comments: 9
core/api/src/main/java/com/alipay/sofa/rpc/config/UserThreadPoolManager.java (1)
- 84-84: The optimization in
getUserThreadPoolSet
by usingaddAll
directly on theHashSet
is a good improvement for efficiency. Well done on enhancing the performance of this method.registry/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistry.java (4)
- 28-28: The addition of the
VisibleForTesting
annotation import is appropriate for indicating the visibility scope of methods intended for testing purposes.- 282-291: Refactoring in the
subscribe
method to filter out disabled instances before updating providers is a robust improvement. It ensures that the system reacts only to relevant changes, enhancing the overall stability.- 149-151: Initializing the
providerObserver
in theinit
method if it's null is a good defensive programming practice. It ensures the component's availability and prevents potential null pointer exceptions.- 365-368: The addition of the
getProviderObserver
method, annotated withVisibleForTesting
, is a clear and effective way to facilitate testing by exposing internal components. This approach enhances testability while maintaining code clarity.registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryTest.java (4)
- 37-48: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [21-45]
The addition of imports for
ConcurrentHashSet
,Set
,ExecutorService
, and others supports the new test functionalities and modifications in existing test methods. These imports are appropriate and necessary for the test context.
- 82-82: The removal of
registry.init()
andAssert.assertTrue(registry.start())
from thesetUp()
method increases flexibility in testing by allowing individual test methods to control the initialization process. This change is particularly relevant for testing specific initialization behaviors, such as in thetestMuiltInit()
method.- 84-105: The addition of the
testMuiltInit()
method is a valuable test case that verifies the idempotency of theinit()
method inNacosRegistry
. It ensures that multiple initializations do not create multiple instances ofNacosRegistryProviderObserver
, which is crucial for the stability and correctness of the initialization logic.- 257-257: Adding
serverConfig.destroy()
calls at the end of test methods is a good practice for ensuring proper cleanup of resources. This prevents potential resource leaks and ensures that each test runs in a clean environment, reducing the risk of interference between tests.Also applies to: 330-330
49349b2
to
d6704a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (6)
all/pom.xml
is excluded by:!**/*.xml
bom/pom.xml
is excluded by:!**/*.xml
registry/pom.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/pom.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/src/test/resources/log4j.xml
is excluded by:!**/*.xml
registry/registry-kubernetes/src/test/resources/sofa-rpc/rpc-config.json
is excluded by:!**/*.json
Files selected for processing (14)
- core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/constant/KubernetesClientConstants.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesClientUtils.java (1 hunks)
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesConfigUtils.java (1 hunks)
- registry/registry-kubernetes/src/main/resources/META-INF/services/sofa-rpc/com.alipay.sofa.rpc.registry.Registry (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService2.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl.java (1 hunks)
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl2.java (1 hunks)
- registry/registry-kubernetes/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker (1 hunks)
Files skipped from review as they are similar to previous changes (14)
- core/api/src/main/java/com/alipay/sofa/rpc/config/RegistryConfig.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistry.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryHelper.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryProviderWatcher.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/constant/KubernetesClientConstants.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesClientUtils.java
- registry/registry-kubernetes/src/main/java/com/alipay/sofa/rpc/registry/kubernetes/utils/KubernetesConfigUtils.java
- registry/registry-kubernetes/src/main/resources/META-INF/services/sofa-rpc/com.alipay.sofa.rpc.registry.Registry
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/KubernetesRegistryTest.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestService2.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl.java
- registry/registry-kubernetes/src/test/java/com/alipay/sofa/rpc/registry/kubernetes/TestServiceImpl2.java
- registry/registry-kubernetes/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
总体设计
样例
环境准备
https://www.docker.com/
https://kubernetes.io/zh-cn/docs/tutorials/hello-minikube/
代码准备
https://github.com/wangchengming666/sofa-rpc-registry-kubernetes-demo
测试手法
Provider部分
docker build -t sofa-rpc-k8s-provider:1.0.0 .
minikube image load sofa-rpc-k8s-provider:1.0.0
kubectl apply -f ServiceAccount.yml
kubectl apply -f Deployment.yml
kubectl get pods -n sofa-rpc-k8s
kubectl logs -f sofa-rpc-k8s-provider-86f8565dcb-m7r6v -n sofa-rpc-k8s
Consumer部分
docker build -t sofa-rpc-k8s-consumer:1.0.0 .
minikube image load sofa-rpc-k8s-consumer:1.0.0
kubectl apply -f Deployment.yml
kubectl get pods -n sofa-rpc-k8s
kubectl logs -f sofa-rpc-k8s-consumer-5d6cd8698d-pf7wd -n sofa-rpc-k8s
Summary by CodeRabbit
RegistryConfig
with methods to retrieve parameters with default values.