This repository provides a comprehensive setup to implement global rate limiting in an EKS (Elastic Kubernetes Service) environment using Istio and Redis.
The repository contains configurations and scripts to set up an EKS cluster, deploy Istio, and implement global rate limiting using both local and remote Redis instances.
- EKS Setup: Terraform scripts to provision an EKS cluster.
- Istio Integration: Configuration files to deploy Istio using helm.
- Rate Limiting: Implement rate limiting using Istio and Redis. Both local and remote (AWS ElastiCache) rate limiting configurations are provided.
- Redis: Configuration to deploy Redis locally within the EKS cluster and also to configure a remote Redis instance using AWS ElastiCache.
- Sample Application: Deployment of a sample httpbin application to demonstrate the rate limiting functionality.
- kubernetes/: Contains Kubernetes configuration files for deploying Istio, Redis, rate limit configurations, and the sample httpbin application.
- terraform/: Contains Terraform scripts for provisioning the EKS cluster, VPC, and other related AWS resources.
- output/: Contains Kubeconfig and Terraform output artifacts.
The makefile
provided takes you through all necessary steps and is self documenting.
$ make
help This help
terraform-up Bring up aws infra with terraform
terraform-down Bring down aws infra with terraform
refresh-k8s-token Refresh eks kubectl kubeconfig token
istio-install Install istio with helm
deploy-redis-cli Deploy redis-cli
deploy-ratelimit-local Deploy local connected ratelimit service
undeploy-ratelimit-local Undeploy local connected ratelimit service
deploy-ratelimit-remote Deploy remote connected ratelimit service
undeploy-ratelimit-remote Undeploy remote connected ratelimit service
deploy-httpbin Deploy test application httpbin
clean Clean up the environment
Navigate to the terraform/ directory and run the Terraform scripts to provision the EKS cluster and related resources.
make terraform-up
Once the EKS cluster is up, deploy Istio using the provided configuration files.
make istio-install
Deploy a redis-cli pod for debugging purposes.
make deploy-redis-cli
Apply the rate limit configurations based on your choice of local or remote Redis.
make deploy-ratelimit-local
make deploy-ratelimit-remote
Deploy the httpbin application and test the rate limiting functionality.
make deploy-httpbin
To delete all the resources run:
make clean
This will destroy the terraform infra and remove output artifacts.
This repository provides a seamless way to integrate rate limiting in an EKS environment using Istio and Redis. It offers flexibility in choosing between global rate limiting with local and remote redis and provides a sample application to demonstrate the functionality.