Deploying an AWS Kubernetes Cluster
  • 30 May 2024
  • 2 Minutes to read
  • Dark
    Light

Deploying an AWS Kubernetes Cluster

  • Dark
    Light

Article summary

Decisions can be hosted in Kubernetes cluster architecture alongside the Redis server and a load balancer.

The following document demonstrates how to set up an Elastic Kubernetes Service (EKS) cluster for AWS.

Prerequisites


Creating a Kubernetes Service with Cloudshell

  1. In AWS, open the AWS CloudShell console by clicking the command prompt icon to the right of the search bar.


  2. Enter the following command to download the YAML template directly to the home directory.
    wget https://decisionspublic.blob.core.windows.net/eks/eksdeploy-example.yaml

  3. Enter the following command to review the YAML in the console.
    vi eksdeploy.yaml

  4. Edit the YAML template to accommodate connection settings according to the reference table below. Save once done.
    Variable NameDefault ValueNew Value
    REPLICAS

    2

    Enter the desired number of Decisions nodes to create in the cluster

    DECISIONS_
    CLUSTERPORTALBASEURL

    http://YOUR-CLUSTER-URL-HERE-local/

    Enter the desired URL to the cluster’s portal.

    This is usually the cluster name and its port number.

    DECISIONS_
    DATABASECONNECTIONSTRING

    tcp:YOUR-RDS-DATABASE.us-west-2.rds.amazonaws.com

    Enter the connection string of the prerequisite RDS database.

    Initial CatalogYOUR-DBEnter the name of the prerequisite RDS database.

    User-IDADMIN-USERNAMEEnter the name of the admin user for the specified RDS database.

    PasswordADMINPASSEnter the password for the specified admin user.

  5. Enter the following command to download the deployment script directly to the home directory.
    wget https://decisionspublic.blob.core.windows.net/eks/eksdeploy.sh

  6. Enter the following command to review the deployment script in the console.
    vi eksdeploy.sh

  7. Edit the deployment script to define the cluster according to the reference table. Save once done.

    Do not alter the name of this script.
    Variable NameDefault ValueNew Value
    CLUSTER_NAMEexample-clusterEnter the desired cluster name.
    REGIONus-east-2

    Enter the region to place the cluster in.

    It is best to match the cluster's region with the RDS DB's region for minimal latency, but these regions can differ.


  8.  To deploy the EKS cluster, run the following command to run the deployment script. This will take several minutes to complete.

    The deployment script will periodically ask if any errors occur as it runs. When prompted, enter "Y" to confirm no errors occurred to progress to the next step of the script until it is complete.
    bash eksdeploy.sh


Verifying the Cluster

  1. After the deployment script completes, enter the following command to check the deployment status. It is a best practice to run this command in case of any errors.
    kubectl get pods -n decisions

  2. Monitor the cluster's deployment. A node is successfully deployed when its status changes from ContainerCreating to Running. 

    If the Ready column remains at 0/1, then the container is down. It will still accept requests and connections from the load balancer once it reaches 1/1.


  3. Once all nodes are set to Running, the container has been successfully deployed. Connect to the cluster via the connection string specified in step 4 of "Creating a Kubernetes Service With Cloudshell".

For further information on Installation, visit the Decisions Forum.

Was this article helpful?