How to get Kubernetes cluster name from K8s API

As stated in the title, is it possible to find out a K8s cluster name from the API? I looked around the API and could not find it.


kubectl config current-context does the trick (it outputs little bit more, like project name, region, etc., but it should give you the answer you need).


Unfortunately a cluster doesn't know its own name, or anything else that would uniquely identify it (K8s issue #44954). I wanted to know for helm issue #2055.