- 09 Aug 2023
- 2 Minutes to read
Deploying an AWS Kubernetes Cluster
- Updated on 09 Aug 2023
- 2 Minutes to read
The following document demonstrates how to set up an Elastic Kubernetes Service (EKS) cluster for AWS.
- 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 templatedirectly to the home directory.
- Enter the following command to review the YAML in the console.
- Edit the YAML template to accommodate connection settings according to the below reference table. Save once done.
Variable Name Default Value New Value REPLICAS
Enter the desired number of Decisions nodes to create in the cluster
Enter the desired URL to the cluster’s portal.
This is usually the cluster name and its port number.
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 scriptdirectly to the home directory.
- Enter the following command to review the deployment script in the console.
- 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 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 make 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 completes.
Verifying the Cluster
- After the deployment scriptcompletes, 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".