Add Kubernetes Cloud Accounts

You can add a deployed Kubernetes cluster to Commander’s inventory as a cloud account.

To add a Kubernetes cluster to Commander as a cloud account, a Kubernetes configuration file (known as a kubeconfig file) is required for the cluster. Commander will encrypt this file and store it in the Commander database to enable cluster access. See Configure Access to Multiple Clusters in the Kubernetes.io documentation for general information on how to generate a kubeconfig file for the cluster.

When you add a Kubernetes cluster, changes made through Commander will be displayed as soon as the tasks for those changes have finished. Commander will also regularly check for updates from the cloud infrastructure where the cluster resides.

You can also use predefined Commander workflows to deploy a Kubernetes cluster, and then use Commander’s orchestration, self-service, and expense management features to manage the cluster.

Add Kubernetes clusters

Access:

Views > Inventory

Available to:

Commander Roles of Superuser and Enterprise Admin

To add a Kubernetes cluster as a cloud account in Commander:

  1. Click the Infrastructure, Applications, or Storage tab.
  2. Select the root node of the Infrastructure, Applications, or Storage tree.
  3. Select Actions > Add Cloud Account.
  4. In the Add Cloud Account dialog, select Kubernetes from Cloud Account Type.
  5. Complete the fields as required:
    • Name: Enter a name for the cloud account. Note that Service Portal users may see this name if they have permission.
    • Configuration File: Click Browse and navigate to the kubeconfig file for the Kubernetes cluster.
  6. For Update Frequency, enter a value from 1 to 180 to set the initial frequency (in minutes) to use to check for updates from the cloud infrastructure where the cluster resides. The frequency at which Commander will check for updates will exponentially increase (to a maximum of 180 minutes) if no updates are detected.

    More frequent updates (a short update frequency setting) may impact performance, especially in large installations.

  7. Click OK.

After the cluster is added to Commander, add the underlying private or public cloud as a cloud account to enable full orchestration and automation for the cluster.

Add GKE clusters

To add a Google Kubernetes Engine (GKE) cluster to Commander as a cloud account, you must configure the authorization and authentication settings for the cluster, then generate a kubeconfig file for the cluster. These configuration steps are required to enable Commander to connect to the GKE cluster.

Once a kubeconfig file is generated, add the cluster to Commander.

Configure the GKE cluster

You can configure the authentication and authorization settings for a GKE cluster.

The following steps show how to configure the cluster through the Google Cloud Platform Console and Cloud Shell console. If you want, you can also use a local shell.

  1. In the Google Cloud Platform Console, go to the Kubernetes Engine page.
  2. In the left menu, click Clusters, and on the Kubernetes clusters page, select the cluster you want to add to Commander.
  3. On the configuration page for the cluster, click Edit, and from Legacy Authorization, select Enabled.

    GCP Cluster Legacy Authorization

  4. Scroll down to the bottom of the page and click Save.

    You can also use the -enable-legacy-authorization gcloud command to enable Legacy Authentication for a GKE cluster. For more information, see gcloud container clusters create in the GCP documentation.

  5. From the top-right corner of the console, click the Activate Google Cloud Shell button Activate Google Cloud Shell button.
  6. In the Cloud Shell session that opens at the bottom of the console, enter the following command to configure the cluster to authenticate with the client certificate:

    gcloud config set container/use_client_certificate true

  7. Enter the following command to generate a kubeconfig file for the cluster:

    gcloud container clusters get-credentials <CLUSTER_NAME>

    where <CLUSTER_NAME> is the name of the cluster.

  8. Change to the .kube directory, where the kubeconfig file is written to:

    cd .kube

    Create GKE cluster kubeconfig

  9. Click the More button, and select Download file.
  10. In the Download file dialog, enter the fully qualified path to the kubeconfig file, then click Download.

    For example: /home/<username>/.kube/config

    The kubeconfig file is downloaded to the your local computer. This kubeconfig file is required to add the Kubernetes cluster as a cloud account to Commander.

Add the GKE cluster in Commander

Access:

Views > Inventory

Available to:

Commander Roles of Superuser and Enterprise Admin

To add a GKE cluster to Commander as a cloud account:

  1. Click the Infrastructure, Applications, or Storage tab.
  2. Select the root node of the Inventory tree.
  3. Select Actions > Add Cloud Account.
  4. In the Add Cloud Account dialog, choose Kubernetes from Cloud Account Type.
  5. Complete the fields as required:
    • Name: Enter a name for the cloud account. Note that Service Portal users may see this name if they have permission.
    • Configuration File: Click Browse to navigate to the kubeconfig file for the cluster. This kubeconfig file will be encrypted and stored in the Commander database to enable cluster access.
  6. Click OK.

If you make changes to the cluster, use the Edit Cloud Account command to replace the kubeconfig file. You can also change the cloud account's name.

To access the clusters in Commander, assign access rights to admin users. For more information, see Assign access rights to administrative users.