argo的输入输出--output和input输出目录或文件到下一步骤(3)
- UID
- 1066743
|
argo的输入输出--output和input输出目录或文件到下一步骤(3)
完整示例代码如下:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: output-artifacts-
spec:
entrypoint: output-artifacts
templates:
- name: output-artifacts
steps:
- - name: generate-artifacts
template: generate
- - name: consume-artifacts
template: consume
arguments:
artifacts:
- name: in-artifact
from: "{{steps.generate.outputs.artifacts.out-artifact}}"
- name: generate
container:
image: docker/whalesay:latest
command: [sh, -c]
args: ["echo -n hello world > /tmp/hello_world.txt"]
outputs:
artifacts:
- name: out-artifact
path: /tmp/hello_world.txt
s3:
endpoint: s3.amazonaws.com
bucket: my-aws-bucket-name
key: path/in/bucket/my-input-artifact.txt
- name: consume
inputs:
artifacts:
- name: in-artifact
path: /tmp/input.txt
container:
image: docker/whalesay:latest
command: [sh, -c]
args: ["
echo 'input artifact contents:' &&
cat /tmp/input.txt
"]
在配置文件中统一配置s3存储引擎
如果在每个使用的地方都去加s3的配置,那代码会很冗余,argo有一个统一的配置可以进行设置。
使用命令编辑配置文件如下:
kubectl edit configmap workflow-controller-configmap -n argo
1
增加内容如下:
data:
config: |
artifactRepository:
s3:
bucket: my-aws-bucket-name
keyPrefix: prefix/in/bucket #optional可选
endpoint: s3.amazonaws.com #AWS => s3.amazonaws.com; GCS => storage.googleapis.com
insecure: true #omit for S3/GCS. Needed when minio runs without TLS
accessKeySecret:
name: my-aws-s3-credentials
key: accessKey
secretKeySecret:
name: my-aws-s3-credentials
key: secretKey |
|
|
|
|
|