DBeaver Documentation

DOWNLOAD pdf

Kubernetes configuration

Note: This feature is available in Lite, Enterprise, Ultimate and Team editions only.

In some scenarios, you may need to interact with databases that are part of a Kubernetes cluster. DBeaver offers a way to configure Kubernetes settings to facilitate this. Before proceeding, ensure that you meet the following prerequisites:

  • You must have the kubectl tool installed on your local machine.

  • You need a Kubernetes configuration file. Use the local one or consult your administrator for access.
  • Setting up Kubernetes

    To set up a tunnel to a Kubernetes cluster in DBeaver, you need to configure the following settings:

    1) First, you need to add a Network Handler for Kubernetes. To do this, click on the Network configurations... button and select Kubernetes.

    2) After making your selection, a new tab will appear in the menu at the top, where you can proceed to configure the various settings.

    Here you need to fill out the following fields:

    Field Description
    Configuration Specify the path to your Kubernetes configuration file.
    Context Manually select a kube-context if your configuration offers multiple contexts for different clusters. The default setting is default.
    Namespace The default value is default, but this may differ in managed Kubernetes environments. Obtain the correct namespace from your kubectl config.
    Resource By clicking the Find Resource button next to the field, a list of available services to connect to will open. From this list, you can select the service you wish to connect to.
    Port Configure Kubernetes port forwarding by using kubectl.

    Tip: When clicking the dropdown menus in Context and Namespace, you can select settings directly from your kubectl config.

    Kubectl settings

    The Kubernetes Command-Line Tool, kubectl, is essential for interacting with Kubernetes clusters and is integral to the functioning of DBeaver's Kubernetes features. Learn more in the official Kubernetes documentation.

    To configure kubectl settings, you have two options:

    1) Click on Configuration button on the Kubernetes connection settings page to access the kubectl settings.

    2) Alternatively, navigate to Window -> Preferences -> Connections -> Command Line Tools -> Kubernetes to specify the path to your kubectl executable.

    Testing port forwarding

    The Test port forwarding button utilizes the kubectl port-forward feature to enable secure access to applications running inside Pods from your local machine. This provides a secure way to interact with the application without exposing it to the outside world. Learn more in the official Kubernetes documentation.

    To test port forwarding:

    1) Fill out the necessary Kubernetes settings as described in the previous section.

    2) Click on the Test port forwarding button to initiate the port forwarding process.

    If the test is successful, this confirms that you can securely access the targeted Kubernetes resource from your local machine using the configured port settings.