apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
https://www.apolloconfig.com
Apache License 2.0
28.94k stars 10.19k forks source link

2.2.0部署在k8s中,本地连不上config。 #5068

Closed Jich1123 closed 4 months ago

Jich1123 commented 6 months ago

描述bug

HELM 部署完2.2.0版本。config的Home Page Url是k8s中的SVC地址http://apollo-service-dev-apollo-configservice.sh-toolchain:8080,本地调试的时候java去通过暴露在外部的Meta Server去连接apollo-config,由于是内部的SVC地址,无法在本地连上。

期望

可以在本地获取到config的配置

截图

image

企业微信截图_17044271381029

dosubot[bot] commented 6 months ago

🤖

你好,@Jich1123!我是Dosu,一个可以帮助你解决问题、回答问题并成为贡献者的机器人。在等待人类维护者的同时,我在这里为你提供帮助。让我们一起解决这个问题吧!

根据我在Apollo存储库中找到的信息,有两个类似的已解决问题可能对您有所帮助。

  1. 关于k8s部署Apollo, 集群外部应用访问ConfigService比较麻烦问题。这个问题的建议解决方案是使用Kubernetes服务发现模式,这应该适用于您的场景。

  2. apollo部署到k8s后,客户端获取不到配置。这个问题的解决方案是查看源码并重启configService。

对于您的问题,您可以尝试使用Apollo客户端的一个特性,该特性允许您跳过Meta Server服务发现并直接指定apollo-configservice地址。这个特性在Apollo客户端版本0.11.0及以上版本中可用。

您可以通过在Apollo客户端的app.properties文件中设置apollo.configService属性来实现这一点。例如:

app.id=SampleApp
apollo.configService=http://your-externally-exposed-meta-server-address

在这个例子中,将http://your-externally-exposed-meta-server-address替换为您的外部暴露的Meta Server的实际地址。

关于Apollo 2.2.0版本中可能影响到在Kubernetes环境中连接到配置服务的更改,我在存储库中没有找到相关信息,但答案可能在其他地方,或者我可能遗漏了。

希望这些信息对您有所帮助。如果您有任何其他问题或需要进一步的帮助,请随时告诉我。

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

stale[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

stale[bot] commented 4 months ago

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.