This repository provides Terraform blueprints for setting up Kubernetes infrastructures efficiently. The goal is to standardize and simplify the provisioning of Kubernetes clusters, reducing setup time, maintenance effort, and ensuring consistency across projects.
Setting up Kubernetes infrastructures often involves repetitive tasks, similar tools, and high maintenance overhead. This project aims to:
- Provide a structured approach to setting up Kubernetes infrastructures.
- Reduce setup costs and complexity.
- Ensure a modular and maintainable architecture.
The infrastructure is structured into three layers:
This layer handles the provisioning of cloud resources such as compute instances, networking, storage, and security configurations. The structure is cloud-agnostic, making it possible to support multiple cloud providers in the future.
- Currently supports AWS EKS.
- Future support planned for Google Cloud (GKE), Microsoft Azure (AKS), Hetzner, etc.
This layer includes essential Kubernetes add-ons for cluster management:
- Monitoring (e.g. Prometheus, Grafana)
- Scaling (e.g. Karpenter)
- Secret Handling (e.g. External Secrets)
- DNS Handling (e.g. External DNS)
This layer is designed for deploying applications and managing workloads:
- Supports Helm-based deployments.
- Enables CI/CD integrations for automated deployments.
- Cloud-Agnostic: Modular design to support multiple cloud providers.
- Automated Provisioning: Uses Terraform to automate infrastructure setup.
- Best Practices: Follows industry best practices for Kubernetes infrastructure.
- Scalability & Maintainability: Designed to grow with your workloads.
- Terraform installed (Download here) or OpenTofu installed (Download here)
- AWS CLI configured (Setup guide)
- kubectl installed (Installation guide)
The repository is structured to help you easily locate the cloud-specific Terraform configurations. Within the terraform
folder, you'll find subdirectories corresponding to different cloud providers. Our goal is to maintain the following structure:
k8s-terraform-blueprints/
├── addon-dependent-workload/
├── addons/
├── cluster-addons/
├── terraform/
│ └── aws/
│ ├── base/
│ └── examples/
├── .gitignore
└── README.md
The examples folder contains various example implementations. Below is a snippet from the AWS EKS production minimal example, which provisions a fully functional VPC and EKS cluster along with layer 2 tooling, following our best practices:
module "base" {
source = "git::git@github.com:valiton/k8s-terraform-blueprints.git//terraform/aws/base?ref=main"
base_name = "my_project"
}
For more details, check out the general AWS base module documentation and the eks-prod-minimal folder.
We welcome contributions! Feel free to open issues and pull requests to improve the project.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions, feel free to reach out via GitHub issues or discussions.