ForgeOps

Kubernetes Cluster Creation

ForgeRock provides shell scripts based on AWS CloudFormation to use for EKS 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 EKS:

  1. Create your cluster:

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

      $ cd /path/to/forgeops/cluster/eks
    2. Run the cluster creation script. Specify the YAML file that contains the configuration for your cluster size. For example[1]:

      $ ./cluster-up.sh small.yaml

      To verify that the cluster has been created, log in to the AWS console. Select the EKS service link. You should see the new cluster in the list of Amazon EKS clusters.

    3. Run the kubectx command:

      $ kubectx
      . . .
      user.name@small.us-east-1.eksctl.io

      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.

  2. Set context to the prod namespace:

    $ kubens prod
  3. 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
      kube-system   aws-node-4fzmz                    1/1     Running   0          9m28s
      kube-system   aws-node-btkf9                    1/1     Running   0          9m23s
      kube-system   aws-node-gbw6b                    1/1     Running   0          9m3s
      kube-system   aws-node-gtp2x                    1/1     Running   0          9m1s
      kube-system   aws-node-klv4t                    1/1     Running   0          9m28s
      kube-system   aws-node-znjt6                    1/1     Running   0          9m4s
      kube-system   coredns-75b44cb5b4-nm824          1/1     Running   0          25m
      kube-system   coredns-75b44cb5b4-xlwpn          1/1     Running   0          25m
      kube-system   kube-proxy-4gxgw                  1/1     Running   0          9m3s
      kube-system   kube-proxy-bb4sr                  1/1     Running   0          9m28s
      kube-system   kube-proxy-knw77                  1/1     Running   0          9m28s
      kube-system   kube-proxy-kwq22                  1/1     Running   0          9m1s
      kube-system   kube-proxy-ptpnf                  1/1     Running   0          9m23s
      kube-system   kube-proxy-zt4t2                  1/1     Running   0          9m4s
      kube-system   metrics-server-5f956b6d5f-nhpmd   1/1     Running   0          12m8s
    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.
Copyright © 2010-2024 ForgeRock, all rights reserved.