This repository demonstrates how to deploy an application on AWS EKS using Kro, ACK controllers, and KCL. This powerful combination simplifies infrastructure management, reduces code duplication, and streamlines the deployment process.
-
Kro: A cloud-agnostic, Kubernetes-native tool for defining and grouping applications and their dependencies. Kro simplifies application management by encapsulating components as a single resource. (Currently experimental and under active development. See the Kro Status Update below.)
-
ACK (AWS Controllers for Kubernetes): Manage AWS service resources directly from your Kubernetes cluster. ACK provides a bridge between your Kubernetes environment and various AWS services.
-
KCL (Kubernetes Configuration Language): A modern configuration language that leverages programming language techniques to generate Kubernetes manifests. KCL promotes DRY (Don't Repeat Yourself) principles and reduces the complexity of managing YAML files.
- Open Source Release (November 2024): Kro is now open-source!
- Cross-Cloud Collaboration (January 2025): Azure, GCP, and AWS are collaborating on Kro's further development.
- Production Readiness: While currently experimental, Kro is actively being prepared for production use.
This repository provides a practical example of deploying a 2048 game on EKS. It uses:
- ACK Controllers: To provision the necessary AWS infrastructure.
- Kro: To package the application and its dependencies.
- KCL: To generate the Kubernetes manifests.
- Kubernetes Cluster (Minikube recommended for testing:
minikube start -p kro
) - AWS Programmatic Access (Configure AWS CLI with credentials)
- Helm (v3.16.2 or later)
-
Install Kro:
# Get latest version export KRO_VERSION=$(curl -sL https://api.github.com/repos/kro-run/kro/releases/latest | jq -r '.tag_name | ltrimstr("v")') # Install with Helm helm install kro oci://ghcr.io/kro-run/kro/kro --namespace kro --create-namespace --version=${KRO_VERSION}
-
Install ACK Controllers:
# Create namespace and AWS secret (replace ./profile.txt with your credentials file) kubectl create ns ack-system kubectl create secret generic aws-credentials -n ack-system --from-file=credentials=./profile.txt # Install controllers (adapt script for desired controllers) ./install-ack-controllers.sh # See provided script example in the repository
-
Install KCL: Follow the instructions on the official KCL website: https://www.kcl-lang.io/docs/user_docs/getting-started/install
-
Install Tekton Pipelines:
kubectl create ns tekton-tasks kubectl get secret aws-credentials -n ack-system -o yaml | sed "s/namespace: ack-system/namespace: tekton-tasks/" | kubectl apply -f - kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
Summary of Steps:
- Infrastructure Provisioning: Use Kro and KCL to define and create the necessary AWS resources (e.g., VPC, subnets, etc.).
- Application Deployment: Use Kro and KCL to define and deploy the 2048 game application. This includes setting up a Tekton pipeline for the deployment process.
- Trigger Pipeline: Initiate the Tekton pipeline to deploy the application to your EKS cluster.
./infra
: Contains KCL code for infrastructure resources../deploy
: Contains KCL code for application deployment../install-ack-controllers.sh
: Example script to install ACK controllers.
resources += [{
id = subnet_config.name
template = {
# ... Subnet configuration details ...
}
} for subnet_config in my_config.subnet_configs]
This example demonstrates a modern and efficient approach to Kubernetes deployments on AWS. By leveraging Kro, ACK, and KCL, you can significantly reduce complexity, improve maintainability, and boost productivity. Refer to the blog post for a comprehensive walkthrough.