Set up Kubernetes cluster on AWS EKS
This page provides steps to set up a Kubernetes Cluster with the persistent volume on Amazon Elastic Kubernetes Service (EKS).
Prerequisites
-
Install
eksctl
. For installation instructions, see the official eksctl documentation for instructions. -
Install
awscli
. For installation instructions, see the official awscli documentation. -
Use the following command to verify whether you can access information related to your account and ARN. This verification confirms that you can connect to and access your Amazon account using the CLI.
aws sts get-caller-identity
Create and configure cluster
Follow these steps to create a KubeConfig
and define a storage class that automatically generates a persistent volume during installation of Appsmith.
-
Create cluster with:
eksctl create cluster --name <CLUSTER_NAME> --region <REGION_NAME> --node-type t2.2xlarge
In the above command, replace:
<REGION_NAME>
: with the region where you'll host the Kubernetes cluster.<CLUSTER_NAME>
: with the name of the cluster.
-
Create KubeConfig with:
aws eks update-kubeconfig --region <REGION_NAME> --name <CLUSTER_NAME> --profile <PROFILE_NAME>
In the above command, replace:
<REGION_NAME>
: with the region where the Kubernetes cluster is hosted.<CLUSTER_NAME>
: with the name of the cluster.<PROFILE_NAME>
: the profile name that has access to the AWS EKS cluster to the--profile
parameter.
-
Test your Kubernetes configuration with:
kubectl cluster-info
The above command provides a summary of the current cluster configuration, including the Kubernetes master and other cluster information.
-
Define a storage class. Follow these instructions for your Kubernetes version:
- Version earlier than 1.23
- Version 1.23 or later
To define a storage class, execute the following command:
kubectl apply -f - <<EOF
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp2
provisioner: kubernetes.io/aws-ebs
EOFFollow these steps to define the storage class:
-
Create an IAM role by following the official Amazon documentation on Creating the Amazon EBS CSI driver IAM role.
-
Add a web identity to the identity provider list with:
eksctl utils associate-iam-oidc-provider --region <REGION_NAME> --cluster <CLUSTER_NAME> --approve
In the above command, replace:
<REGION_NAME>
: with the region where the Kubernetes cluster is hosted.<CLUSTER_NAME>
: with the name of the cluster.
-
Add the Amazon Elastic Block Store (Amazon EBS) Container Storage Interface (CSI) driver chart repository:
helm repo add aws-ebs-csi-driver https://kubernetes-sigs.github.io/aws-ebs-csi-driver
-
Update the Amazon EBS CSI driver repository:
helm repo update
-
Install the Amazon EBS CSI driver:
helm upgrade --install aws-ebs-csi-driver --namespace kube-system aws-ebs-csi-driver/aws-ebs-csi-driver
-
Verify the installation of the Amazon EBS CSI driver:
kubectl get pods -n kube-system -l app.kubernetes.io/name=aws-ebs-csi-driver
-
Add
AmazonEC2FullAccess
policy to the cluster and the node group. -
Mark the
gp2
class as default with:kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}
Next steps
Troubleshooting
If you are facing issues contact the support team using the chat widget at the bottom right of this page.