How to get Kubernetes cluster name from K8s API
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.
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).