Score:0

Accessing the Kubernetes API from a Pod

rw flag

I am trying to access to Kubernetes API from a Pod using Java Client library. I have followed in cluster config example from below URL: https://github.com/kubernetes-client/java/blob/master/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java

I am able to run it successfully locally but when I deploy it in GCP Kubernetes, and trying to invoke the service from within a pod, it is not working and giving below error: org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver [http-nio-8080-exec-1] Resolved [java.nio.file.NoSuchFileException: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt

I tried to find locate the certificate in '/var/run/secrets/kubernetes.io/serviceaccount' path within pod, but it's not available and that is why I am getting this error.

Could you please help to understand what is wrong with that.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.