Spring cloud config server not pulling from Git backend

12/25/2019

I am using spring cloud config server on openshift. The Git repository is the backend. I am getting below error when I update any property in the Git repo.

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]
-- Javed A
configserver
kubernetes
openshift
spring

1 Answer

12/25/2019

Your app has spring-cloud-kubernetes dependency on the classpath and there is no kubernetes service account configured for this deployment.

This is why it's throwing an error, because it's not related to Spring Cloud Config Server. Configure service account or remove the mentioned dependency if you don't use it, so you pass this problem and will be able to configure config server.

-- Czolg
Source: StackOverflow