Configuring a physical connection to a Kubernetes cluster

When you want to test internal services in a Kubernetes cluster by using HCL OneTest API, you must first configure the physical connection to a Kubernetes cluster in HCL OneTest API.

Before you begin

You must have completed the following tasks:
  • Completed setting up of the latest version of a Kubernetes cluster in your IT infrastructure and ensured that various services run in the Kubernetes cluster.
  • Configured a kubeconfig file with access to the Kubernetes cluster in a folder on the computer on which you installed HCL OneTest API.

Procedure

  1. Open the Physical View of the Architecture School perspective.
  2. On the toolbar of the Physical View, click General > Kubernetes Cluster.

    The New Kubernetes Cluster dialog is displayed with the Config tab open.

  3. Enter a name for the connection to the Kubernetes cluster in the Name field.
    Note: When you assign a name, it helps you to identify the connection if there are multiple Kubernetes connections in your project.
  4. Perform the following steps to import the details from the kubeconfig file:
    1. Click Import, and then click Open Kubeconfig File in the Import from a kubeconfig dialog that is displayed.
    2. Browse to the folder on your computer where you have stored the kubeconfig file, and then select the file.
    3. Click Open.

      The contents of the kubeconfig file are displayed in the field in the Import from a kubeconfig dialog.

    4. Select the service that you want to test, which is displayed in the Select the context to import list.
    5. Click Next.

      The Import Certificates dialog is displayed.

      You can either create a new identity store and client key password or use an existing one that you have already created.

    6. Enter the passwords for the following items:
      • Identity store
      • Client key

      If you create a new identity store, then the identity store is displayed as a physical resource.

    7. Click Finish.

      The relevant details are populated in the corresponding fields in the New Kubernetes Cluster dialog for the physical connection in HCL OneTest API.

  5. Enter the namespace in the Kubernetes cluster that contains the service that you want to test in the Namespace field.
    Note: If you do not provide a namespace, HCL OneTest API considers the default value of the namespace as default.
  6. Click Test Connection to verify that the connection works.

    You can close the dialog that is displayed after the connection is validated.

  7. Click OK.

Results

You configured the physical connection to the Kubernetes cluster in your project.

What to do next

You can use the synchronization feature in HCL OneTest API to synchronize with the application that is owned by the service in the Kubernetes cluster. See Synchronizing application resources of a Kubernetes cluster service in HCL OneTest API.