Boilerplate for Kubernetes Infrastructure As Code in AWS using Terraform (Updated at 2023-11-13)
To build infrastructure, you need the following tools:
- AWS CLI
- Terraform CLI
- kubectl
$ terraform init
$ terraform plan
$ terraform apply --auto-approve
$ aws eks --region <REGION> update-kubeconfig --name <CLUSTER_NAME>
If you select ClusterIP
as service.type
, you can connect through port-forwarding as follows.
$ kubectl port-forward -n grafana deploy/grafana 8081:3000
If you select LoadBalancer
, you will be able to directly access the Endpoint of the LoadBalancer.
- Kubernetes 1.28+ on EKS
- 2AZ, Public/Private/Intra Subnets
- 2 Managed Nodegroups(Frontend, Backend)
- Cluster AutoScaling with Karpenter
- AWS Node Termination Handler
- Ingress Controller with AWS Load Balancer
- EFK Log Pipeline
- Fleunt-bit
- AWS Opensearch Service
- Opensearch DashBoard (Kibana Alternative)
- Cluster Montioring
- Prometheus
- Grafana
- K8s Metric Server
- Cert Manager, Etc.
<IMEKS>
├── LICENSE
├── README.md
├── assets
│ ├── sample/
│ └── terraform_backend/
└── src/
└─ helm_values/
src/
: Infrastructrue as code.assets/sample/
: Sample services to run on the cluster.assets/terraform_backend
: Backend for managing Terraform State.