AWS Fargate for EKS (Fargate) provides on-demand, right-sized compute capacity for Kubernetes pods. With Fargate, you no longer need to provision, configure, or scale groups of virtual machines to run your pods. This removes the need to choose server types, decide when to scale your node groups, or optimize cluster packing. You can control which pods start on Fargate and how they run using Fargate profiles, which are defined as part of your Amazon EKS cluster.
For teams looking to deliver Namespace-as-a-service using AWS Fargate for EKS, one of the challenges they need to address is to automate the creation of Fargate profiles. With Nirmata, you can automate the creation of Fargate profiles for EKS clusters. This enables you to deliver Namespace-as-a-service to your developers without requiring any admin intervention.
In this post, we will discuss how to automate creation of Fargate profiles to deliver Namespace-as-a-service using AWS Fargate for EKS.
Configuring Default Fargate Profile Settings
First, you can set up the default Fargate profile settings in the cluster type. These default settings will be used whenever a Fargate profile is automatically created
- Pod Execution Role ARN: Specify the default Pod Execution Role ARN. You will need to create a Pod Execution Role in your AWS account using the instructions here.
- Subnets: Specify the subnets where your Fargate pods will be running.
- Namespace Label Selectors: Label selector for namespaces to enable Fargate for EKS.
- Pod Label Selectors: Label selector for pods to be added to the Fargate profile.
Now, any cluster that is created using this cluster type will get the default Fargate profile settings.
Create an Environment Type
Next, you can create an environment that can be used by developers to request a Fargate-enabled namespace.
You will need to label this environment type with the same label used in the ‘Namespace Label Selector’ in the default Fargate profile settings.
Create an Environment
Now, when a new environment is created with the previously created environment type, the labels will be applied to the namespace that is created. This will trigger the creation of the Fargate profile on the EKS cluster. Once the Fargate profile is created, any pods created in this namespace will be deployed on their own nodes. Nodes will automatically be provisioned when new pods are created and the nodes will be deleted when the pods are deleted delivering a severless experience.
AWS Fargate for EKS enables you to deliver a severless experience for your Kubernetes applications. Now, with the integration of Fargate with Nirmata, you can automatically provision the necessary Fargate profiles to enable serverless containers. This integration not only allows you to eliminate the need to manage and maintain Kubernetes nodes but it also delivers cost savings as you no longer need to pre-provision any nodes. You can try out this feature with a free trial of Nirmata. Let us know what you think!