ForgeOps

Kubernetes cluster creation

ForgeRock provides shell scripts based on the Google Cloud SDK to use for GKE cluster creation. Use them when you deploy the CDM. After you’ve finished deploying the CDM, you can use the CDM as a sandbox to explore a different infrastructure-as-code solution, if you like.

When you create a project plan, you’ll need to identify your organization’s preferred infrastructure-as-code solution, and create your own cluster creation automation scripts, if necessary.

Here are the steps the Cloud Deployment Team followed to create a Kubernetes cluster on GKE:

  1. Create the cluster:

    1. Change to the directory that contains the cluster creation script:

      $ cd /path/to/forgeops/cluster/gke
    2. Source the script that contains the configuration for your cluster size. For example:

      $ source ./small.sh
    3. Run the cluster creation script[1]:

      $ ./cluster-up.sh

      If you’re prompted to install Google Cloud SDK beta components, enter Y to install them.

      The script creates:

      • The cluster

      • The ds-pool node pool (for large clusters only)

      • The fast storage class

      • The ds-snapshot-class volume snapshot class

      • The prod namespace

      • The cluster-admin-binding cluster role binding

    4. To verify that the script created the cluster, log in to the Google Cloud console. Select the Kubernetes Engine option. You should see the new cluster in the list of Kubernetes clusters.

    5. Run the kubectx command.

      The output should contain your newly created cluster and any existing clusters.

      The current context should be set to the context for your new cluster.

    6. Set the active namespace in your local Kubernetes context to any namespace in your new cluster.

      The cluster-up.sh script creates the prod namespace. You can deploy the CDM in the prod namespace, or, if you prefer, create another namespace for CDM deployment.

  2. Check the status of the pods in your cluster until all the pods are ready:

    1. List all the pods in the cluster:

      $ kubectl get pods --all-namespaces
      NAMESPACE     NAME                           READY   STATUS    RESTARTS   AGE
      gmp-system    alertmanager-0                 2/2     Running   0          2m9s
      gmp-system    collector-2n8zx                2/2     Running   0          72s
      gmp-system    collector-94f7p                2/2     Running   0          71s
      gmp-system    collector-tpb5c                2/2     Running   0          72s
      gmp-system    gmp-operator-7656bfd55b-2tllm  1/1     Running   0          2m11s
      . . .
    2. Review the output. Deployment is complete when:

      • The READY column indicates all running containers are available. The entry in the READY column represents [total number of containers/number of available containers].

      • All entries in the STATUS column indicate Running or Completed.

    3. If necessary, continue to query your cluster’s status until all the pods are ready.

Next step


1. The cluster creation script adds a set of required labels to clusters created by ForgeRock employees. The first time you run the script, it prompts you to specify whether you’re a ForgeRock employee or not, so that it can add these labels if appropriate. You should not receive this prompt during subsequent executions of the script.