Presenters
Source
Kargo: Unleashing GitOps Beyond Kubernetes ๐
Hey tech enthusiasts! Ever felt the frustration of managing your applications when they spill out of the cozy confines of Kubernetes? You’re not alone! In a world where real-world applications are a tapestry of Kubernetes clusters, S3 buckets, Lambda functions, and CDNs, keeping everything synchronized and manageable can be a real headache. Today, we’re diving deep into how Kargo, the brilliant open-source GitOps promotion layer above Argo CD, is stepping up to the plate, breaking down those silos and extending the power of GitOps beyond Kubernetes.
Jesse Sudin, Co-founder and CTO of Akuity and an original creator of the Argo project, recently shared some exciting developments about Kargo. And let me tell you, the future looks bright! โจ
The GitOps Challenge: Beyond the Cluster ๐
While Argo CD is a powerhouse for Kubernetes deployments, it’s often only part of the story. Most applications have dependencies and components that live outside the cluster. Trying to shoehorn these into Kubernetes Custom Resource Definitions (CRDs) or objects, as some tools suggest, can feel like trying to fit a square peg into a round hole. ๐ฉ
This is where Kargo shines, offering a more elegant and integrated solution.
Introducing Kargo: Your Universal Promotion Layer ๐ ๏ธ
For those new to Kargo, think of it as your unlimited promotion pipeline and multi-environment visibility supercharger for your existing Argo workflows. But the big news is that Kargo is no longer just for Kubernetes. It’s expanding its horizons, and it’s starting with Terraform! ๐ฆพ
How Kargo Orchestrates Your Multi-Target Deployments ๐ฏ
Kargo’s magic lies in its ability to continuously monitor your Git repositories for new artifacts. When a new artifact is pushed, Kargo intelligently combines the latest versions of these artifacts into a new, promotable entity called freight. These freight items then appear on a timeline, ready to be promoted across your various environments.
Let’s break down what this looks like in practice:
-
Artifact Types: Kargo can handle a diverse range of artifacts, including:
- Docker containers for your Kubernetes applications (e.g., a guestbook app). ๐ณ
- Infrastructure-as-code configurations like IAM policy files, stored directly in Git. ๐
- Serverless functions like AWS Lambda, published as OCI artifacts in ECR. โก
-
The GitOps Repository Backbone: Your entire deployment strategy is driven by a Git repository. This repository is structured to manage your environments:
- Environments Directory: A dedicated folder for each environment (e.g.,
dev,staging,prod). - Kubernetes Configuration: Within each environment, a
kubernetesdirectory holding your Helm values files. ๐ - Terraform Configuration: Alongside, a
terraformdirectory containing your.tffiles,.tfvars, and even your state files. ๐ณ
- Environments Directory: A dedicated folder for each environment (e.g.,
Kicking Off a Production Promotion: A Seamless GitOps Flow ๐
Imagine you want to promote a change from staging to production. Here’s how Kargo makes it a breeze:
-
Initiating the Promotion: You simply instruct Kargo to promote changes, for instance, to make production match the version currently running in staging.
-
Git-Centric Operations: Because Kargo is all about GitOps, every promotion is a series of Git changes:
- Kargo copies and edits files within your Git repository.
- It commits these changes.
- It then invokes the underlying tools (like Terraform) to perform the actual deployment.
-
Production-Ready Review: For critical production promotions, Kargo can be configured to create a pull request. This ensures that all changes are reviewed before being merged, adding an essential layer of safety. โ
-
Automated Merge and Execution: Once the pull request is approved and merged, Kargo springs into action.
What Happens Under the Hood During a Promotion? ๐ง
Let’s peek at the Git commits Kargo generates:
- Kubernetes Configuration Update: A YAML update to your Helm values file, incorporating the new image tag. ๐ก
- Terraform Configuration Update: An HCL update to your
.tfvarsfile, reflecting the new Lambda image version. ๐ป - Policy File Promotion: The promoted policy JSON file is copied directly into the environment’s directory.
- Terraform Plan Capture: Kargo captures the Terraform plan, giving you an exact preview of what will be applied. ๐
The Terraform to Kubernetes Hand-off: Solving a Common Pain Point ๐ค
Here’s where things get really interesting. Terraform plans can produce outputs โ for example, a newly generated Lambda function URL. The challenge? Your Kubernetes application needs this URL, but you often don’t know it until after the Terraform apply.
Traditionally, passing this value from Terraform to Kubernetes is a manual, two-step process or requires complex tooling. But Kargo elegantly solves this!
- Terraform Apply: After the PR merge, Kargo runs
terraform apply. - Capture Terraform Output: It then executes
terraform outputto retrieve that newly generated function URL. ๐ก - Update Kubernetes Config: Crucially, Kargo takes this URL and updates your Kubernetes configuration, specifically the Helm values file, with this dynamic information.
- Commit and Sync: The updated Helm values file is committed back into Git.
- Argo CD Sync: You’ll see Argo CD automatically sync to this new commit.
- Environment Variable Update: When you inspect your Kubernetes pods, you’ll find that the environment variable has indeed been updated with the new Lambda function URL.
This seamless coordination from Terraform to Kubernetes, all managed automatically by Kargo, is a game-changer! ๐
The Future is Universal GitOps ๐
As you can see, Kargo is evolving into a universal promotion layer. It’s taking the proven principles of GitOps and extending them far beyond Kubernetes. Whether you’re deploying to Terraform, Lambdas, VMs, or any system you deliver to, Kargo is poised to be your central orchestrator.
This expansion means more consistency, more visibility, and less manual toil across your entire application delivery landscape.
If you’re keen to explore this further, be sure to stop by the Akuity booth for a chat. And for those looking to deepen their understanding of Argo CD, keep an eye out for book signings with the authors of “Argo CD Up and Running” this Wednesday at 11:00 AM! ๐
The era of truly universal GitOps is here, and Kargo is leading the charge! ๐ฏ