A self-hosted content delivery network based on Kubernetes. Easily setup Kubernetes clusters in multiple AWS regions and deploy resilient and reliable services to a global user base within minutes.
This project was developed by Ilhaan Rasheed during his tenure as a DevOps Engineering Fellow at Insight. The capabilities of this project have been demonstrated using video streaming as an example. Ilhaan's presentation slides with a short demo is available here.
Here is a detailed blog post about kubeCDN.
Before deploying your self-hosted CDN using kubeCDN, you will need the following:
- AWS account and credentials with appropriate permissions to setup EC2 instances, VPCs and EKS clusters. All documentation and software components of this project assumes that
awscliis being used to manage AWS credentials.
- Install Terraform. This project was developed using Terraform v0.11.11.
kubectlv1.13.2 or higher.
helmv2.12.3 or higher. On macOS, you can install helm using
brew install kubernetes-helm.
After the components above have been installed, clone this repo and proceed to the next section.
Deploy Clusters & Service
- Deploy Clusters
- To deploy EKS clusters in multiple regions, follow instructions from here.
- Setup Route53
- Instructions to setup Route53 can be found here.
- Install ExternalDNS
- Follow instructions here.
- Install Monitoring tools
- Install Prometheus and Grafana by following instructions here.
- Deploy Demo Video Server
- To demonstrate kubeCDN, a simple Nginx based RTMP streaming server was created. Follow instructions here for more information on this server and for deploy instructions.
Follow these instructions to teardown all deployed services and infrastructure.
- First, all services that have been deployed need to be removed. There is a script in the root directory of this repo that performs this task. Run it using:
- The second teardown step is to remove all infrastructure that was setup in step 1 of the section above. This can be done by navigating to the
terraformdirectory and running the following:
terraform destroy -auto-approve
This process takes about 10 minutes to complete with two regions.
- After successful run of the previous step, all infrastructure associated with kubeCDN should have been torn down. Verify this on AWS Console in order to avoid accidental charges on your account.