View and Download kubeconfig Files

This section introduces how to view and download the kubeconfig file.

The kubeconfig file contains authentication information for the cluster, enabling other applications to access the cluster. KubeSphere supports automatically generating the kubeconfig file based on the current logged-in user, granting the same access permissions to other applications. For more information, please refer to the Kubernetes documentation.

Prerequisites

You should have KubeSphere username and password.

Steps

  1. Log in to the KubeSphere web console.

  2. Hover over the image::/images/ks-qkcp/zh/icons/hammer.svg[hammer,18,18] icon in the bottom right corner of the page, then click kubeconfig from the menu.

  3. In the pop-up dialog, view the kubeconfig configuration information.

    • The clusters:cluster:server field displays a virtual IP address for access, which can only be accessed from within the cluster. If you need to access it from outside the cluster, modify this address to the one exposed by the kube-apiserver.

    • The contexts:cluster:namespace field defaults to the project name default. Modify this field value to the actual project name that the current user has access to.

    • Click image::/images/ks-qkcp/zh/icons/download-dark.svg[download-dark,18,18] to download the kubeconfig.yaml file to your local machine.