Argo 101 - 2 : S3/Minio Storage

继续研究使用Argo;

Argo基本概念

再熟悉下 Argo 的核心概念:

  • Workflow
  • Template,可以看作是functionArgo中的Template有两类:
    • 定义Template
      • container,最常见的,也是Argo的优势
      • script,基于container,你可以写点什么
      • resouce,直接操作k8s的任何resource
      • suspend,暂停一段时间,等同于 Thread.wait(int time)
    • 调用Template
      • steps,直接调用其他Template
      • DAG,以DAG的方式调用其他Template
  • Entrypointmain function,第一个执行的 Template
  • ArtifactArgo更perfer使用S3来存储artifact

Argo配置Minio

还记得Argo会默认在Argo的namespace下安装一个全新的Minio么?现在来干掉它,复用其他已有的Minio;

kubectl delete pod/minio -n argo
kubectl delete service/minio  -n argo

需要修改两个configmapartifact-repositories + workflow-controller-configmap;同时还需要修改 my-minio-cred

s3:
  bucket: my-bucket
  endpoint: minio:9000
  insecure: true
  accessKeySecret:
    name: my-minio-cred
    key: accesskey
  secretKeySecret:
    name: my-minio-cred
    key: secretkey

kubectl editkubectl apply后,跑个DAG,看看是否能成功连接Minio

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: artifact-passing-
spec:
  entrypoint: artifact-example
  templates:
  - name: artifact-example
    steps:
    - - name: generate-artifact
        template: whalesay
    - - name: consume-artifact
        template: print-message
        arguments:
          artifacts:
          # bind message to the hello-art artifact
          # generated by the generate-artifact step
          - name: message
            from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}"

  - name: whalesay
    container:
      image: docker/whalesay:latest
      command: [sh, -c]
      args: ["cowsay hello world | tee /tmp/hello_world.txt"]
    outputs:
      artifacts:
      # generate hello-art artifact from /tmp/hello_world.txt
      # artifacts can be directories as well as files
      - name: hello-art
        path: /tmp/hello_world.txt

  - name: print-message
    inputs:
      artifacts:
      # unpack the message input artifact
      # and put it at /tmp/message
      - name: message
        path: /tmp/message
    container:
      image: alpine:latest
      command: [sh, -c]
      args: ["cat /tmp/message"]

Argo submit

在这里插入图片描述

同时,登陆Minio看一眼,artifact是否upload成功

在这里插入图片描述
Okey,没问题!

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值