需要在 Kubernetes 上编排批处理、数据管道、CI 任务或机器学习流水线。Argo Workflows 用 YAML 定义 DAG 或步骤,每个节点是一个 Pod,适合云原生任务编排。
kubectl。kubectl create namespace argo
kubectl apply -n argo -f https://github.com/argoproj/argo-workflows/releases/latest/download/install.yaml
kubectl -n argo get pods
helm repo add minio https://charts.min.io/
helm install minio minio/minio \
--namespace argo \
--set rootUser=admin,rootPassword='***' \
--set buckets[0].name=artifacts
kubectl -n argo create secret generic artifact-repositories \
--from-literal=default-v1.yaml='
s3:
bucket: artifacts
endpoint: minio:9000
insecure: true
accessKeySecret:
name: minio
key: rootUser
secretKeySecret:
name: minio
key: rootPassword
'
kubectl -n argo label secret artifact-repositories \
workflows.argoproj.io/artifact-repositories=default
kubectl apply -n argo -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: etl-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: extract
template: echo
arguments:
parameters: [{name: msg, value: extract}]
- name: transform
depends: extract
template: echo
arguments:
parameters: [{name: msg, value: transform}]
- name: echo
inputs:
parameters:
- name: msg
container:
image: busybox
command: [sh, -c]
args: ["echo {{inputs.parameters.msg}}"]
EOF
argo list -n argo
argo logs -n argo @latest
kubectl -n argo port-forward svc/argo-server 2746:2746
Succeeded。ttlStrategy 没配置,完成的 Workflow 无限增长。argo — 提交、查看、日志和重试kubectl — 查看 Workflow 和 Podhelm — 安装 MinIOmc — 检查 artifact 桶