Mantis 是一个统一的基础架构即代码框架,它取代了 Terraform 和 Helm。
AI-first queryable Infrastructure as Code tool that is an alternative to Terraform and Helm
Introduction
Mantis is a next-generation Infrastructure as Code (IaC) tool that reimagines how we manage cloud and Kubernetes resources. Built as a fork of OpenTofu and powered by CUE, Mantis combines the best of Terraform and Helm while solving their limitations.
To manage cloud resources, Mantis compiles CUE configurations into Terraform compatible json and leverages the Opentofu engine to orchestrate it. To manage K8s resources, Mantis compiles CUE configurations yaml manifests which can be deployed either using mantis or via integrations with Gitops tools like ArgoCD or FluxCD
⚠️ Note: Mantis is under active development. APIs and CLI interfaces may change.
MacOS/Linux
brew install pranil-augur/homebrew-mantis/mantisDeploy a cloud-native Flask application integrated with AWS RDS and managed through Kubernetes. We'll walk through the structure of the example code, how the tasks are broken down, and how the CUE-based modules simplify reusable infrastructure components.
Let’s dive into the file structure and flow that powers this deployment.
Project File Structure Below is the structure of the example deployment:
tree -L 2
.
├── cue.mod
│ └── module.cue # Defines the module name and CUE version
├── defs
│ ├── deployment.cue # Deployment configurations for the Flask app
│ ├── rds.cue # RDS database configurations
│ ├── variables.cue # Variable definitions and inputs
│ └── providers.cue # Providers configuration
└── install_flask_app.tf.cue # Main Mantis flow for deploying the appThis file structure reflects how Mantis organizes infrastructure code using modular and reusable CUE configurations. Let's look at what each file and directory does.
Main Flow Code
The main flow file orchestrates the entire deployment process by:
The core syntax of the main flow is:
deploy_flask_rds: {
@flow(deploy_flask_rds)
# Define the tasks that make up the flow
task_1: {
@task(mantis.core.TF) // Terraform task
...
}
task_2: {
@task(mantis.core.TF)
dep: [task_1] // Define task dependencies
...
}
task_3: {
@task(mantis.core.K8s) // Kubernetes task
dep: [task_1, task_2] // Define task dependencies
...
}
}This file defines the module name and CUE language version being used for the project. It also allows dependencies to be managed across the project.
module: "augur.ai/rds-flask-app"
language: {
version: "v0.10.0"
}
// Define the dependencies for the project
dependencies: [
"abc.xyz.com/module1",
"abc.xyz.com/module2",
]Purpose: This ensures the project remains compatible across various CUE versions and clearly identifies the module for import across multiple flows.
…good first issue tag . Read the contribution guidelines here. 暂无开放 Issues,或尚未同步最近议题。