Skip to main content
Skip table of contents

GCP: Create a Managed Cluster Using the DKP CLI

Use this procedure to create GCP Managed clusters using the DKP command line interface (CLI)

When creating Managed clusters, you do not need to create and move CAPI objects, or install the Kommander component. Those tasks are only done on Management clusters!

Choose a Workspace for the New Cluster

  1. If you have an existing Workspace name, run this command to find the name:
    ⚠️ NOTE: If you need to create a new Workspace, follow the instructions to Create a Workspace.

    kubectl get workspace -A
  2. When you have the Workspace name, set the WORKSPACE_NAMESPACE environment variable:

    export WORKSPACE_NAMESPACE=<workspace_namespace>

Name your Cluster

  1. Give your cluster a unique name suitable for your environment.

    In GCP it is critical that the name is unique, as no two clusters in the same GCP account can have the same name.

  2. Set the environment variable:

    export CLUSTER_NAME=<gcp-additional>

The cluster name may only contain the following characters: a-z, 0-9, ., and -. Cluster creation will fail if the name has capital letters. See Kubernetes for more naming information.

To increase Docker Hub's rate limit, use your Docker Hub credentials when creating the cluster by setting the following flag, --registry-mirror-url= --registry-mirror-username=<username> --registry-mirror-password=<password> on the dkp create cluster command.

Create a New GCP Cluster

Availability zones (AZs) are isolated locations within data center regions from which public cloud services originate and operate. Because all the nodes in a node pool are deployed in a single Availability Zone, you may wish to create additional node pools is to ensure your cluster has nodes deployed in multiple Availability Zones.

By default, the control-plane Nodes will be created in 3 different zones. However, the default worker Nodes will reside in a single zone. You may create additional node pools in other zones with the dkp create nodepool command. The default region for the availability zones is us-west1.

Google Cloud Platform does not publish images. You must first build the image using Konvoy Image Builder.

  1. Create an image using Konvoy Image Builder (KIB) and then export the image name:

    export IMAGE_NAME=projects/${GCP_PROJECT}/global/images/<image_name_from_kib>
  2. Create a Kubernetes cluster. The following example shows a common configuration. See dkp create cluster gcp reference for the full list of cluster creation options:

    dkp create cluster gcp \
    --cluster-name=${CLUSTER_NAME} \
    --additional-tags=owner=$(whoami) \
    --project=${GCP_PROJECT} \
    --image=${IMAGE_NAME} \

    If your environment uses HTTP/HTTPS proxies, you must include the flags --http-proxy, --https-proxy, and --no-proxy and their related values in this command for it to be successful. More information is available in Configuring an HTTP/HTTPS Proxy.

Manually Attach a DKP CLI Cluster to the Management Cluster

  1. Find out the name of the created Cluster, so you can reference it later:

    kubectl -n <workspace_namespace> get clusters
  2. Attach the cluster by creating a KommanderCluster:

    cat << EOF | kubectl apply -f -
    kind: KommanderCluster
      name: <cluster_name>
      namespace: <workspace_namespace>
        name: <cluster_name>-kubeconfig
          name: <cluster_name>

Next Step:

Day 2 - Cluster Operations Management

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.