0

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.

0 Answers0