- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 02-12-2025 08:53 AM
Creating and deleting EKS cluster in the existing VPC
Introduction:
This guide demonstrates how to create an Amazon EKS (Elastic Kubernetes Service) cluster within existing VPCs and subnets, and how to remove it using the same configuration file with a single command.
It’s not a recommendation but just an example of the working solution and you have to adjust it according to your needs.
Step-by-Step Guide:
1. Prerequisites
If you haven’t connected to your AWS account yet, you need to configure it. You can either create a dedicated Linux bastion or use your local laptop.
- VPC Requirements: Ensure that there is a VPC with both public and private subnets in each of the three availability zones of your chosen region. Each node group must use only one availability zone.
- AWS CLI Installation: Depending on your operating system (bastion or laptop), install the appropriate version of the AWS CLI (Linux / MacOS / Windows). For installation instructions, visit: AWS CLI Installation.
- AWS Credentials Configuration: Configure your AWS credentials using one of the available methods. For guidance, refer to: AWS CLI Configuration.
- Install eksctl: Install the eksctl command-line tool. For installation instructions, visit: eksctl Installation.
2. Setting up cluster.yaml file
The configuration below is valid and was tested with eksctl version 0.193.0. Replace the values in metadata.name, region, and the public and private subnet IDs with your own, and save it as cluster.yaml. As for the ‘version’ please refer to the Kubernetes Compatibility Matrix https://docs.sisense.com/main/SisenseLinux/linux-minimum-requirements.htm
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: cluster-test
region: us-east-2
version: "1.30"
vpc:
nat:
gateway: Enable
subnets:
private:
us-east-2a:
id: subnet-022d3d9104ab651b4
us-east-2b:
id: subnet-0b1c2ac0216e101c2
us-east-2c:
id: subnet-09c84f9835a0ae13f
public:
us-east-2a:
id: subnet-0fab7bc831ca7a25a
us-east-2b:
id: subnet-062966c1571fcef50
us-east-2c:
id: subnet-08f3dbb5e5fae4b20
managedNodeGroups:
- name: query-a
labels:
node-sisense-Application: "true"
node-sisense-Query: "true"
iam:
withAddonPolicies:
autoScaler: true
awsLoadBalancerController: true
certManager: true
ebs: true
efs: true
fsx: true
instanceType: m5a.2xlarge
desiredCapacity: 1
minSize: 1
maxSize: 2
volumeSize: 300
availabilityZones: ["us-east-2a"]
- name: query-b
labels:
node-sisense-Application: "true"
node-sisense-Query: "true"
iam:
withAddonPolicies:
autoScaler: true
awsLoadBalancerController: true
certManager: true
ebs: true
efs: true
fsx: true
instanceType: m5a.2xlarge
desiredCapacity: 1
minSize: 1
maxSize: 2
volumeSize: 300
availabilityZones: ["us-east-2b"]
- name: build
labels:
node-sisense-Build: "true"
iam:
withAddonPolicies:
autoScaler: true
awsLoadBalancerController: true
certManager: true
ebs: true
efs: true
fsx: true
instanceType: m5a.2xlarge
desiredCapacity: 1
minSize: 1
maxSize: 2
volumeSize: 300
availabilityZones: ["us-east-2c"]
Explanation of YAML Parameters
- apiVersion: Specifies the version of the eksctl API being used. This is important for compatibility with the features and configurations available in that version.
- kind: Defines the type of resource being created. In this case, it is a ClusterConfig, which indicates that the configuration is for an EKS cluster.
- metadata: Contains metadata about the cluster.
- name: The name of the EKS cluster. This should be unique within the region.
- region: The AWS region where the cluster will be created (e.g., us-east-2).
- version: The Kubernetes version to be used for the cluster (e.g., "1.30").
- vpc: Configuration related to the Virtual Private Cloud (VPC) where the EKS cluster will be deployed.
- gateway: Indicates whether to enable a NAT gateway for the cluster. Setting it to Enable allows private subnets to access the internet.
- private: Lists the private subnets by availability zone, each identified by its subnet ID.
- public: Lists the public subnets by availability zone, each identified by its subnet ID.
- nat: Configuration for Network Address Translation (NAT) gateways.
- subnets: Defines the subnets to be used for the cluster.
- managedNodeGroups: Configuration for the managed node groups that will run the workloads in the EKS cluster. Each node group can have its own settings.
- withAddonPolicies: Specifies which AWS services and features the node group should have permissions for, such as:
- autoScaler: Enables the Kubernetes Cluster Autoscaler.
- awsLoadBalancerController: Grants permissions for the AWS Load Balancer Controller.
- certManager: Grants permissions for managing SSL/TLS certificates.
- ebs: Grants permissions for Amazon Elastic Block Store.
- efs: Grants permissions for Amazon Elastic File System.
- fsx: Grants permissions for Amazon FSx.
- name: The name of the node group.
- labels: Key-value pairs used to organize and select the nodes in the group.
- iam: IAM role and policies associated with the node group.
- instanceType: The EC2 instance type to be used for the nodes (e.g., m5a.2xlarge).
- desiredCapacity: The desired number of nodes in the node group.
- minSize: The minimum number of nodes in the node group.
- maxSize: The maximum number of nodes in the node group.
- volumeSize: The size of the EBS volume (in GiB) attached to each node.
- availabilityZones: Specifies the availability zones where the nodes in the group will be deployed.
- After setting up file you can create a cluster with the
eksctl create cluster -f cluster.yaml
command
- Obtain the kubernetes configuration by running the following command:
aws eks update-kubeconfig --region us-east-2 --name cluster-test
- A shared storage (FSX) must be created manually
aws fsx create-file-system --file-system-type LUSTRE --storage-capacity 1200 --tags Key="Name",Value="cluster_test" --subnet-ids "subnet-0b1c2ac0216e101c2" --lustre-configuration "DeploymentType=PERSISTENT_1,PerUnitStorageThroughput=100"
--file-system-type LUSTRE - only this type is supported by Sisense
--storage-capacity 1200 - the minimal 1200 GB storage for FSX Lustre
--tags - update the name and other tags needed
--subnet-ids "..." - one of the subnets of your VPC
--lustre-configuration - according to the parameters supported
https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-fsx-lustre.html
Conclusion: A summary of key takeaways or final points.
The steps above should help you prepare an EKS cluster for the SIsense installation.
The cluster can be deleted with the single command: eksctl delete cluster -f cluster.yaml --disable-nodegroup-eviction
References/Related Content: Links and resources for further reading.
- https://docs.sisense.com/main/SisenseLinux/linux-minimum-requirements.htm
- https://docs.sisense.com/main/SisenseLinux/autoscaling-and-linux.htm
- https://docs.sisense.com/main/SisenseLinux/deploying-sisense-on-amazon-eks.htm
- https://eksctl.io/usage/creating-and-managing-clusters/
- https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
- https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
- https://eksctl.io/installation/
- https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-fsx-lustre.html