fabric8io / spring-cloud-kubernetes

Kubernetes integration with Spring Cloud
Apache License 2.0
701 stars 198 forks source link

KubernetesClientException - Configured service account doesn't have access #86

Open dkirrane opened 6 years ago

dkirrane commented 6 years ago

I'm using a Kubernetes cluster created with kubeadm. I'm hitting the following:

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://kubernetes.default.svc/api/v1/namespaces/default/configmaps/my-config. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. configmaps "my-config" is forbidden: User "system:serviceaccount:default:default" cannot get configmaps in the namespace "default".

How do I access ConfigMaps on Kubernetes (Documentation only mentions steps for OpenShift)

jherimum commented 6 years ago

@dkirrane im having the same problem! Did you solve it?

ghost commented 6 years ago

hello guys, i have no found any property in spring.cloud.kubernetes related to authentication via token. Any advices?

maxbert commented 5 years ago

Hey Guys, Also having this problem, any solution?

tiarebalbi commented 3 years ago

Same issue...

2020-10-29 19:28:18.188 WARN 1 --- [ main] o.s.c.k.config.ConfigMapPropertySource : Can't read configMap with name: [accounts] in namespace:[XXXXX]. Ignoring.
io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://10.32.0.1/api/v1/namespaces/XXXX/configmaps/accounts. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. configmaps "accounts" is forbidden: User "XXXXX" cannot get resource "configmaps" in API group "" in the namespace "XXXX".
apiVersion: v1
kind: ConfigMap
metadata:
  name: accounts
data:
  spring.datasource.url: <REMOVED>
tiarebalbi commented 3 years ago

Fixes the problem: https://docs.spring.io/spring-cloud-kubernetes/docs/current/reference/html/index.html#service-account