Skip to content

argo-workflows

一、安装

Argo Workflows

官方文档

1.安装

1.找到对应版本并安装 https://github.com/argoproj/argo-workflows/releases

2.暴露 service

apiVersion: v1
kind: Service
metadata:
  name: argo-server
  namespace: argo
spec:
  ports:
  - name: web
    nodePort: 30003
    port: 2746
    protocol: TCP
    targetPort: 2746
  selector:
    app: argo-server
  type: NodePort
2.使用argocd dex登陆

官方文档

1.创建通信密钥并在 argo-workflow 与 argo-cd 名称空间中部署

# 密钥内容为引号中字符使用base64加密后的结果 可以自己定义
# 如果自定义请将以下所有资源中相关处修改为变更后的内容

apiVersion: v1
kind: Secret
metadata:
  name: argo-workflows-sso
data:
  # client-id is 'argo-workflows-sso'
  client-id: YXJnby13b3JrZmxvd3Mtc3Nv
  # client-secret is 'MY-SECRET-STRING-CAN-BE-UUID'
  client-secret: TVktU0VDUkVULVNUUklORy1DQU4tQkUtVVVJRA==

2.向 argo-cd 的组件 argocd-dex-server 中添加 env

kubectl  -n argocd edit deployments.apps argocd-dex-server

apiVersion: apps/v1
kind: Deployment
metadata:
  name: argocd-dex-server
spec:
  template:
    spec:
      containers:
        - name: dex
        # 以下为添加的内容
          env:
            - name: ARGO_WORKFLOWS_SSO_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: argo-workflows-sso
                  key: client-secret
3.向 dex 认证配置中加入 argo-workflow

kubectl  -n argocd edit configmaps argocd-cm

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
data:
  dex.config: |
  # 以下为添加的内容
    staticClients:
      - id: argo-workflows-sso
        name: Argo Workflow
        redirectURIs:
          - https://argo-workflows.mydomain.com/oauth2/callback # argo-workflows地址
        secretEnv: ARGO_WORKFLOWS_SSO_CLIENT_SECRET

3.向 argo-server 添加参数 --auth-mode=sso

kubectl  -n argo edit deployments.apps argo-server

apiVersion: apps/v1
kind: Deployment
metadata:
  name: argo-server
spec:
  template:
    spec:
      containers:
        - name: argo-server
          args:
            - server
            - --auth-mode=sso

4.修改配置

kubectl  -n argo edit configmaps workflow-controller-configmap

apiVersion: v1
kind: ConfigMap
metadata:
  name: workflow-controller-configmap
data:
  sso: |
    issuer: https://argo-cd.mydomain.com/api/dex # argocd dex地址
    clientId: # 最开始定义的密钥
      name: argo-workflows-sso
      key: client-id
    clientSecret:
      name: argo-workflows-sso
      key: client-secret
    redirectUrl: https://argo-workflows.mydomain.com/oauth2/callback # argo-workflows地址

Pipelines

安装

1.安装pipeline

可参考:https://github.com/argoproj-labs/argo-dataflow/blob/main/docs/QUICK_START.md

kubectl apply -f https://raw.githubusercontent.com/argoproj-labs/argo-dataflow/main/config/quick-start.yaml

2.添加 argo 权限

kubectl edit clusterrole argo-server-cluster-role

...
- apiGroups:
  - dataflow.argoproj.io
  resources:
  - pipelines
  - steps
  verbs:
  - create
  - get
  - list
  - watch
  - update
  - patch
  - delete

argo-events

安装

可参考:https://argoproj.github.io/argo-events/installation/

kubectl create namespace argo-events
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/manifests/install.yaml
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/manifests/install-validating-webhook.yaml
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/eventbus/native.yaml
Back to top