java - KubernetesClientException:操作:[list] for kind:[Endpoints] with name: [null] in namespace: [null] failed
问题描述
请询问有关带有 Kubernetes 的 SpringBootAdmin 服务器的问题。
我有一个非常简单的 SpringBootAdmin Server 应用程序如下
@EnableScheduling
@EnableDiscoveryClient
@EnableAdminServer
@EnableConfigServer
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class);
}
}
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-kubernetes</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>2.3.0</version>
</dependency>
它在本地机器上启动良好。但是,当放到 Kubernetes 环境中时,它会产生:
ERROR [,e6d057e7abaf4a65,e6d057e7abaf4a65,true] 62 --- [ scheduling-1] o.s.c.k.d.KubernetesCatalogWatch : Error watching Kubernetes Services
io.fabric8.kubernetes.client.KubernetesClientException: Operation: [list] for kind: [Endpoints] with name: [null] in namespace: [null] failed.
at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:64) ~[kubernetes-client-4.10.3.jar!/:na]
为什么那些 [null] 请?我确实用过
spring.cloud.kubernetes.config.namespace=my-namespace
请问是什么问题?
谢谢
解决方案
推荐阅读
- django - 任何人都可以为我的 django 项目建议一个数据库模式吗?
- javascript - 提交空搜索请求时出现错误“TypeError: Cannot read property 'map' of undefined”
- jira - Leverice 中的 Jira 通道状态
- powershell - pwsh -Command 正在删除引号
- python-3.x - 如何替换 python.pandas 中的数据头?
- c++ - 如何用qt实现定时器?
- node.js - 使用 Node.js 向用户发送通知
- javascript - 在本地使用 NodeJs、Express 和 React 的 Cors 问题
- python - Python / Pandas:Excel CSV UTF-8 文件中的列标题问题
- powershell - 在这个具体的例子中如何填写 URL & Filename 参数