Kubernetes: How to access a label value of the current running pod from code using K8's API?
<p>Imagine I got a Kubernetes cluster which has 3 pods and each pod has its own value for the label 'name' and what I actually want is each time I run/open my app, I'd see the name of pod (so its label's value) on console output. 
Of course the output/value may be different each time, based on which pod is being used. </p>

<p>So, Is there any way to access the value of a pod label of the application (pod) running from code? </p>

<p>My app is based on Java (Spring Boot) by the way.</p>

<p>Thanks.</p>