Install Argo Workflows

Release v3.4.3 · argoproj/argo-workflows (github.com)

CLI

# Download the binary
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.4.3/argo-linux-amd64.gz # Unzip
gunzip argo-linux-amd64.gz # Make binary executable
chmod +x argo-linux-amd64 # Move binary to path
mv ./argo-linux-amd64 /usr/local/bin/argo # Test installation
argo version

Controller and Server

kubectl create namespace argo
kubectl apply -n argo -f https://github.com/argoproj/argo-workflows/releases/download/v3.4.3/install.yaml

Patch argo-server authentication

kubectl patch deployment \
argo-server \
--namespace argo \
--type='json' \
-p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args", "value": [
"server",
"--auth-mode=server"
]}]'

ingress for the UI

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argo-ingress
namespace: argo
annotations:
ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/backend-protocol: https # ingress-nginx
spec:
defaultBackend:
service:
name: argo-server
port:
number: 2746
rules:
- host: argo-workflow.sdaas.com
http:
paths:
- backend:
service:
name: argo-server
port:
number: 2746
path: /
pathType: Prefix

Port-forward the UI

kubectl -n argo port-forward deployment/argo-server 2746:2746

This will serve the UI on https://localhost:2746. Due to the self-signed certificate, you will receive a TLS error which you will need to manually approve.

Submitting an example workflow

Submit an example workflow (CLI)

argo submit -n argo --watch https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/hello-world.yaml

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: hello-world-
labels:
workflows.argoproj.io/archive-strategy: "false"
annotations:
workflows.argoproj.io/description: |
This is a simple hello world example.
You can also run it in Python: https://couler-proj.github.io/couler/examples/#hello-world
spec:
entrypoint: whalesay
templates:
- name: whalesay
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["hello world"]

You can list all the Workflows you have submitted by running the command below:

argo list -n argo
argo get -n argo @latest
argo logs -n argo @latest

Walk Through

Parameters

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: hello-world-parameters-
spec:
# invoke the whalesay template with
# "hello world" as the argument
# to the message parameter
entrypoint: whalesay
arguments:
parameters:
- name: message
value: hello world templates:
- name: whalesay
inputs:
parameters:
- name: message # parameter declaration
container:
# run cowsay with that message input parameter as args
image: docker/whalesay
command: [cowsay]
args: ["{{inputs.parameters.message}}"]
argo submit -n argo --watch arguments-parameters.yaml -p message="goodbye world"

RBAC (需要调试)

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: argo-workflow
rules:
# pod get/watch is used to identify the container IDs of the current pod
# pod patch is used to annotate the step's outputs back to controller (e.g. artifact location)
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- watch
- patch
- list
- create
# logs get/watch are used to get the pods logs for script outputs, and for log archival
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- watch
- list
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: argo-default-workflow
namespace: argo
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: argo-workflow
subjects:
- kind: ServiceAccount
name: argo
namespace: default

最新文章

  1. 表值函数与JS中split()的联系
  2. BootStrap 杂记
  3. Nginx 切片模块、断点续传
  4. 把web项目部署到tomocat上
  5. 2016年11月2日--Window.document对象
  6. 【MongoDB】3.详细命令集合
  7. A feature in Netsuite Reports > Financial > Balance Sheet
  8. SharePoint表单和工作流 - Nintex篇(六)
  9. 传统解析xml的方式
  10. Arduino 使用舵机库时 其它引脚输出怪异 解决方案
  11. c#结束winword.exe进程、
  12. Android WebView的loadData方法注意事项
  13. jqGrid源代码分析(一)
  14. UVA 1386 Cellular Automaton
  15. Csocket基本原理
  16. 设计模式六大原则(PHP)
  17. pythhon_如何读写json数据
  18. Scrum笔记
  19. 《从Paxos到ZooKeeper分布式一致性原理与实践》学习笔记
  20. 2016年3月1日Android实习笔记

热门文章

  1. STM32F4库函数初始化系列:三重ADC——DMA
  2. SPI的 CLK_POL和CLK_PHA
  3. 2021级《JAVA语言程序设计》上机考试试题5
  4. vue3 语法糖setup 兄弟组件传值
  5. Centos7系统编译Hadoop3.3.4
  6. 推荐一款.Net Core开发的后台管理系统YiShaAdmin
  7. Naughty Stone Piles
  8. .NET AsyncLocal 避坑指南
  9. js控制关闭layui的switch开关
  10. yak远程服务端搭