Getting Started with Containerized API on EKS Auto Mode

Fastah containerized API offers enterprises a large volume, low latency, high security deployment model. The containers are compatible with AWS Elastic Kubernetes Service(EKS)

Prerequisites


  1. Create a subscription to the AWS Marketplace container product: https://aws.amazon.com/marketplace/pp/prodview-5wfjzgmvvdnr6
  2. Have a preconfigured VPC with at least 2 public subnets
    1. Public subnets are subnets that have outbound routing to the internet and AWS first party services that advertise a public IP address in their DNS lookups.
    2. To configure this product on a private subnet requires allow listed VPCE access to AWS first party services such as Marketplace Metering and Marketplace Docker repository. Contact us at: [email protected] for more details.

Login with your aws credentials and Amazon ECR(as given below)

Login to the Fastah Amazon ECR and enable Helm OCI support

aws ecr get-login-password --region us-east-1 | helm registry login --username AWS --password-stdin 709825985650.dkr.ecr.us-east-1.amazonaws.com
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 709825985650.dkr.ecr.us-east-1.amazonaws.com

export HELM_EXPERIMENTAL_OCI=1

Create EKS cluster

Note: You will require separate EKS cluster to isolate the Fastah service

# Create EKS cluster
eksctl create cluster --name fastah-cluster --region ap-south-1 --enable-auto-mode

# Update Kubeconfig to set the EKS cluster
aws eks update-kubeconfig --name fastah-cluster --region ap-south-1

You may change the value for region(ap-south-1) accordingly to your choice.

Note that Fastah uses Amazon EKS Auto Mode feature and it manages the EKS cluster in optimized manner. Above command will take around 20 minutes to complete



Starting the fastah application

Create Namespace for hosting the application

kubectl create namespace fastah

Deploying the applications with helm chart

helm install --namespace fastah ip-location-service oci://709825985650.dkr.ecr.us-east-1.amazonaws.com/fastah/ip-location-container-p1 --version 2024.12.30

How to get the Cluster IP load balancer FQDN

kubectl get svc -n fastah

Note: Wait for 2 minutes to ensure all the containers are active

Testing the application

Important note: By default, the Fastah application would be accessible only within the Aws VPC. You might need to enable the VPC pairing to access from other VPCs.

# You would be able check the status from any machine with in the VPC or by accessing the container 
# Below command will list IP Location for 98.97.16.1 
curl http://ip-location-service-fastah-ip-location-lb.fastah.svc.cluster.local:8080/whereis/v1/json/98.97.16.1 

# Application build info
curl http://ip-location-service-fastah-ip-location-lb.fastah.svc.cluster.local:8080/env


Debugging

List the nodes, deployments, pods, services and get pods

kubectl get nodes
kubectl get deployments -n fastah
kubectl get svc -n fastah
kubectl get pods -n fastah

Listing all the namespaces and all events on the namespace

kubectl get namespace 
kubectl get events -n fastah

How to access the container running on the namespace

You will run the first command and get pods, then use the second command

# First get all the pods and then mention one of the pod to access the shell 
kubectl get pods -n fastah 

# Note: fastah-ip-location-service-674996b688-568c9 is example pod in the below command to access shell
kubectl exec -n fastah --stdin --tty fastah-ip-location-service-674996b688-568c9  -- /bin/bash

Clean up Cluster

How to delete namespace

kubectl delete namespace fastah

How to delete fatash EKS cluster

Caution! This will delete all part of EKS cluster like: instances, VPCs, etc. It takes around 10 minutes to complete.

eksctl delete cluster --name fastah-cluster --region  ap-south-1 --wait