-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes Discovery error - You should look into this if things aren't working as you expect. Are you missing serviceaccount permissions? #80
Comments
fixed by creating serviceaccount. |
This should be added to the documentation. |
I'm facing the same problem, and the serviceaccount is the default. |
@scipionyx Have you given the $ oc policy add-role-to-user view system:serviceaccount:default:myproject |
I'm also facing this issue on a selfhosted cluster. I assigned the view role (clusterRole) to the default serviceaccount in the default namespace:
The view Role is somewhat limited though. In my observation ( But even if I create a dedicated service-account and grant full api access it is unable to get the necessary objects. Something else seems to be in the way and I can't figure it out. |
I am facing an issue while trying to access configmap from Spring Boot application. The pod containing the application failed to start . 08:30:09.516 [main] DEBUG io.fabric8.kubernetes.client.Config - Trying to configure client from Kubernetes config... Here is the attached code and pom.xml Here is attached serviceaccount.yml , roles.yml, rolebindings.yml,configmap.yml deployment.yml and service.yml |
I feel like the cleanest thing to do would be to define a role specifically for this. The question is what permissions it needs to have. The docs suggest a view called "cluster-reader" that I don't have on my cluster. I'm using Typhoon. |
any update ? |
FYI spec:
automountServiceAccountToken: true <-- this
containers: |
I have the same issue.
|
Hey there, Any help would be appreciated |
Hello, just want to check if there's a way to not fail app start up if the service account doesn't work? Thanks! |
I am facing a similar issue where a spring boot application isn't able to read from configmap intermittently. SA, Role & RoleBinding are correct and it generally works post I delete my replicaSet. Would appreciate any help in how to debug that further, probably some debug logs? |
This project was migrated to https://github.com/spring-cloud/spring-cloud-kubernetes and is no longer maintained. You should try asking in that repository. |
11:53:53.862 [main] DEBUG io.fabric8.kubernetes.client.Config - Trying to configure client from Kubernetes config...
11:53:53.876 [main] DEBUG io.fabric8.kubernetes.client.Config - Did not find Kubernetes config at: [/.kube/config]. Ignoring.
11:53:53.876 [main] DEBUG io.fabric8.kubernetes.client.Config - Trying to configure client from service account...
11:53:53.877 [main] DEBUG io.fabric8.kubernetes.client.Config - Found service account ca cert at: [/var/run/secrets/kubernetes.io/serviceaccount/ca.crt].
11:53:53.880 [main] DEBUG io.fabric8.kubernetes.client.Config - Found service account token at: [/var/run/secrets/kubernetes.io/serviceaccount/token].
11:53:53.880 [main] DEBUG io.fabric8.kubernetes.client.Config - Trying to configure client namespace from Kubernetes service account namespace path...
11:53:53.880 [main] DEBUG io.fabric8.kubernetes.client.Config - Found service account namespace at: [/var/run/secrets/kubernetes.io/serviceaccount/namespace].
2017-04-19 11:53:57.134 WARN 6 --- [ main] i.f.s.cloud.kubernetes.StandardPodUtils : Failed to get pod with name:[kubernetes-discovery-27485661-9ds67]. 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/myproject/pods/kubernetes-discovery-27485661-9ds67. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked..
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:320) ~[kubernetes-client-2.2.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:267) ~[kubernetes-client-2.2.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:239) ~[kubernetes-client-2.2.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:232) ~[kubernetes-client-2.2.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleGet(OperationSupport.java:228) ~[kubernetes-client-2.2.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleGet(BaseOperation.java:711) ~[kubernetes-client-2.2.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.get(BaseOperation.java:192) ~[kubernetes-client-2.2.0.jar!/:na]
at io.fabric8.spring.cloud.kubernetes.StandardPodUtils.internalGetPod(StandardPodUtils.java:56) [spring-cloud-kubernetes-core-0.1.6.jar!/:na]
at io.fabric8.spring.cloud.kubernetes.StandardPodUtils.lambda$new$0(StandardPodUtils.java:40) [spring-cloud-kubernetes-core-0.1.6.jar!/:na]
at io.fabric8.spring.cloud.kubernetes.LazilyInstantiate.swapper(LazilyInstantiate.java:41) ~[spring-cloud-kubernetes-core-0.1.6.jar!/:na]
at io.fabric8.spring.cloud.kubernetes.LazilyInstantiate.lambda$new$0(LazilyInstantiate.java:34) ~[spring-cloud-kubernetes-core-0.1.6.jar!/:na]
at io.fabric8.spring.cloud.kubernetes.LazilyInstantiate.get(LazilyInstantiate.java:29) ~[spring-cloud-kubernetes-core-0.1.6.jar!/:na]
at io.fabric8.spring.cloud.kubernetes.profile.KubernetesProfileApplicationListener.addKubernetesProfile(KubernetesProfileApplicationListener.java:49) ~[spring-cloud-kubernetes-core-0.1.6.jar!/:na]
at io.fabric8.spring.cloud.kubernetes.profile.KubernetesApplicationContextInitializer.initialize(KubernetesApplicationContextInitializer.java:53) ~[spring-cloud-kubernetes-core-0.1.6.jar!/:na]
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:611) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:348) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:175) ~[spring-cloud-context-1.2.0.RELEASE.jar!/:1.2.0.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98) ~[spring-cloud-context-1.2.0.RELEASE.jar!/:1.2.0.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64) ~[spring-cloud-context-1.2.0.RELEASE.jar!/:1.2.0.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:73) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:336) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at com.rsystems.kubernetes.Application.main(Application.java:34) ~[classes!/:1.2]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[app.jar:1.2]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[app.jar:1.2]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) ~[app.jar:1.2]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) ~[app.jar:1.2]
The text was updated successfully, but these errors were encountered: