To connect to a Kubernetes cluster, you usually use kubectl. kubectl is a powerful and flexible command-line tool for managing Kubernetes clusters, providing a.
simple and consistent interface for interacting with Kubernetes resources and performing operations on the cluster
When a user runs a kubectl command, kubectl sends an HTTP request to the Kubernetes API server using the API endpoint specified in the kubectl configuration file. The API server then processes the request, performs the requested operation, and returns a response to kubectl.
The API server uses authentication and authorization mechanisms to ensure that only authorized users can access and modify resources in the cluster.
By default, kubectl uses the credentials and configuration information stored in the .kube/config file to authenticate and authorize requests to the API server

Having access to the cluster configuration file can potentially allow an attacker to view, modify, or delete resources in the cluster, as well as perform other malicious actions. Therefore, it is important to ensure that access to the cluster configuration file is tightly controlled and restricted to only those who need it.