I want to use fabric8 kubernetes client (java) inside a pod to obtain the cluster it is deployed on.
Currently, I can obtain the context using:
KubernetesClient client = new DefaultKubernetesClient();
return client.getConfiguration();
When running locally, I can see the current kubernetes context. However, when it is run on the deployed pod, I am unable to see the kubernetes context.
Why is it not working on the deployed pod? How can I detect the kubernetes cluster the pod is deployed on?