Deploying an AWS Kubernetes Cluster
- 19 Feb 2024
- 2 Minutes to read
- Print
- DarkLight
Deploying an AWS Kubernetes Cluster
- Updated on 19 Feb 2024
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
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
- An active AWS Account
- An RDS database for the cluster by following the Creating an Amazon RDS DB instance article in AWS's documentation.
Creating a Kubernetes Service with Cloudshell
- In AWS, open the AWS CloudShell console by clicking the command prompt icon to the right of the search bar.
- 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
- Enter the following command to review the YAML in the console.
vi eksdeploy.yaml
- Edit the YAML template to accommodate connection settings according to the reference table below. Save once done.
Variable Name Default Value New Value REPLICAS 2
Enter the desired number of Decisions nodes to create in the cluster
DECISIONS_
CLUSTERPORTALBASEURLhttp://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_
DATABASECONNECTIONSTRINGtcp:YOUR-RDS-DATABASE.us-west-2.rds.amazonaws.com
Enter the connection string of the prerequisite RDS database. Initial Catalog YOUR-DB Enter the name of the prerequisite RDS database. User-ID ADMIN-USERNAME Enter the name of the admin user for the specified RDS database. Password ADMINPASS Enter the password for the specified admin user. - Enter the following command to download the deployment script directly to the home directory.
wget https://decisionspublic.blob.core.windows.net/eks/eksdeploy.sh
- Enter the following command to review the deployment script in the console.
vi eksdeploy.sh
- 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 Name Default Value New Value CLUSTER_NAME example-cluster Enter the desired cluster name. REGION us-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.
- 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
- 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
- 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. - 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?