VK Cloud logo

Connecting to a cluster using Headlamp

Headlamp is a graphical interface (GUI) for managing Kubernetes clusters in the Managed Containers service. Headlamp is a more modern and flexible alternative to Lens that allows you to view and edit cluster resources in a browser or a local application without manual kubectl commands.

You can install Headlamp in two ways:

  • Directly in the cluster (In-cluster mode). In this mode, Headlamp is installed in the Kubernetes cluster as a single pod. Inside this pod, Headlamp works as a proxy to the Kubernetes API: the browser accesses Headlamp, which accesses the Kubernetes API server. In this mode, you can configure centralized access to the cluster for a group of users without having to install the application on each user's device.

  • Locally on your computer as an application (Desktop mode). In this mode, when you launch Headlamp, a local Headlamp server and a web interface in the form of an application window are also started in the background. This mode offers better performance and is best suited for individual work with the cluster.

For more information, see the official Headlamp documentation.

Preparatory steps

  1. Create a cluster if you have not done so already.

  2. Make sure that you can connect to the cluster using kubectl.

  3. On the host from which you plan to connect to the cluster, install kauthproxy if the utility is not installed yet:

    1. Download the archive of the required version from the releases page:

      • for Linux: kauthproxy_linux_....zip;
      • for macOS: kauthproxy_darwin_....zip;
      • for Windows: kauthproxy_windows_....zip.
    2. Extract the archive.

    3. Place the executable file in a directory that is included in the PATH environment variable, for example:

      • for Linux and macOS: in /usr/local/bin;
      • for Windows: in C:\.
  4. On the host from which you plan to connect to the cluster, install the Helm client if you have not done so already.

Installing Headlamp

  1. Add the Headlamp repository:

    helm repo add headlamp https://kubernetes-sigs.github.io/headlamp/helm repo update
  2. Create the headlamp namespace and install Headlamp into it:

    helm install my-headlamp headlamp/headlamp --namespace headlamp --create-namespace
  3. Make sure that the pod where Headlamp is installed is running:

    kubectl get pods -n headlamp

    The command output should show the pod status as Running.

Other ways to install Headlamp in a cluster are described in the official documentation.

Connecting to the cluster

Here is a broken tab container
  1. Launch the Headlamp application. The page of the cluster whose configuration file you downloaded earlier will open automatically. If you specified more than one cluster, select the desired one manually.
Was this article helpful?