A simple Golang-based Container-as-a-Service (CaaS) REST API that manages AWS EKS clusters using the AWS SDK for Go (v2).
It allows you to create, delete, list clusters and deploy Kubernetes manifests via kubectl.
caas-eks-api-go/
├── cmd/
│ └── main.go
├── api/
│ └── router.go
├── handlers/
│ └── cluster.go
├── service/
│ └── eks.go
├── models/
│ └── cluster.go
├── docs/ # Swagger files (auto-generated)
├── deployment.yaml
├── go.mod / go.sum
├── Makefile
└── README.md
---
- Create EKS Clusters
- Delete EKS Clusters
- List existing clusters
- Describe specific cluster
- Deploy Kubernetes apps using
kubectl apply
- Go 1.19+
- AWS CLI configured (
aws configure) kubectlinstalled and in your systemPATH- IAM permissions for EKS + EC2 + IAM + VPC
cd ~
cd working
git clone https://github.com/mpwusr/AWSSDKPluginGo.git
cd AWSSDKPluginGo
go mod tidy
go run main.goAPI Usage Create a Cluster
curl -X POST http://localhost:8080/clusters \
-H "Content-Type: application/json" \
-d '{
"name": "caas-demo",
"role_arn": "arn:aws:iam::123456789012:role/EKSClusterRole",
"subnet_ids": ["subnet-abc", "subnet-def"],
"security_groups": ["sg-01234"],
"version": "1.27"
}'
List All Clusters
curl http://localhost:8080/clusters
Deploy an App to a Cluster Ensure deployment.yaml is valid and present.
curl -X POST http://localhost:8080/clusters/caas-demo/deploy
License MIT License. See LICENSE for more info.