-4

我在 openshift 上使用 spring 云配置服务器。Git 存储库是后端。当我更新 Git 存储库中的任何属性时,我遇到了错误。

2019-12-25 12:10:36.988  WARN 1 --- [nio-8080-exec-1] o.s.cloud.kubernetes.StandardPodUtils    : Failed to get pod with name:[config-server-32-66p47]. You should look into this if things aren't working as you expect. Are you missing serviceaccount permissions?

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://kubernetes.default.svc/api/v1/namespaces/ci-dev/pods/config-server-32-66p47. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. pods "ms-config-server-32-66p47" is forbidden: User "system:serviceaccount:ci-dev:default" cannot get resource "pods" in API group "" in the namespace "ci-dev".
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:472) ~[kubernetes-client-3.1.10.jar!/:na]
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:409) ~[kubernetes-client-3.1.10.jar!/:na]
4

1 回答 1

1

您的应用程序spring-cloud-kubernetes依赖于类路径,并且没有为此部署配置 kubernetes 服务帐户。

这就是它抛出错误的原因,因为它与 Spring Cloud Config Server 无关。如果您不使用它,请配置服务帐户或删除提到的依赖项,这样您就可以通过此问题并能够配置配置服务器。

于 2019-12-25T20:55:01.687 回答