Argo Workflows(1.7万星)2026:K8s原生流水线引擎,支持DAG与步骤执行
Argo Workflows(16,878星)是K8s原生的工作流引擎,用于运行容器化流水线——DAG、步骤和定时调度。本文教你部署并运行第一个工作流。
💡 你将学到
Argo Workflows(16,878星)是K8s原生的工作流引擎,用于运行容器化流水线——DAG、步骤和定时调度。本文教你部署并运行第一个工作流。
直接给结论
argoproj/argo-workflows(16,878星,Go)是一个Kubernetes开源工作流引擎。每个工作流步骤都是一个容器,流程用DAG或线性序列定义。它是K8s原生CI/CD、ML流水线和批处理的事实标准。
核心能力
- 容器原生:每个步骤都是一个Kubernetes Pod
- DAG支持:带依赖关系并行运行步骤
- 定时工作流:调度周期性流水线
- 制品:通过S3、GCS或卷在步骤间传递数据
- UI:带日志、指标和可视化的Web仪表盘
部署并运行第一个工作流
# 安装控制器
kubectl create namespace argo
kubectl apply -n argo -f https://raw.githubusercontent.com/argoproj/argo-workflows/master/manifests/quick-start-postgres.yaml
# 安装CLI
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.6.2/argo-linux-amd64.gz
gunzip argo-linux-amd64.gz && chmod +x argo-linux-amd64 && sudo mv ./argo-linux-amd64 /usr/local/bin/argo
# 提交hello工作流
argo submit -n argo --watch https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/hello-world.yaml
示例:并行DAG
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: build
template: whalesay
- name: test
template: whalesay
dependencies: [build]
- name: deploy
template: whalesay
dependencies: [test]
- name: whalesay
container:
image: docker/whalesay
command: [cowsay, "hello"]
实用技巧
- 每个步骤都设置资源请求/限制,避免吵闹邻居问题。
- 大步骤间传文件用制品仓库(S3)。
- 用
argo list和Web UI监控;为控制器数据库开启持久化。
FAQ
需要Kubernetes吗? 需要——Argo Workflows跑在K8s上(minikube或真实集群)。
和Airflow比怎么样? Airflow(46,389星)以Python为中心、基于VM;Argo是容器原生、K8s原生。按你的平台选。
免费吗? 是——开源(Apache-2.0)。
相关文章
❓ 常见问题
Do I need Kubernetes?
Yes - Argo Workflows runs on Kubernetes (minikube or a real cluster).
How does it compare to Airflow?
Airflow (46,389 stars) is Python-centric and VM-based; Argo is container-native and native to K8s. Pick based on your platform.
Is it free?
Yes - open source (Apache-2.0).
本站文章由编辑人工撰写,收录的工具均经过实测或公开资料核验。文中链接指向工具官网或 GitHub 仓库,仅作信息参考,不构成付费推广。
