Skip to content

Instantly share code, notes, and snippets.

@fvdnabee
Last active June 10, 2020 07:53
Show Gist options
  • Save fvdnabee/0a97a58dce6be9baec4041e046f5682e to your computer and use it in GitHub Desktop.
Save fvdnabee/0a97a58dce6be9baec4041e046f5682e to your computer and use it in GitHub Desktop.
argo use the same argument artifacts in multiple steps
# Like parameters, artifacts can be "passed" to a template as well.
# In this example, the 'kubectl-input-artifact' template requires
# that an an artifact named 'kubectl' is supplied as an input,
# which it will place in /usr/local/bin/kubectl. This keeps the
# template more composable/flexible, than if the location was
# hard-wired inside the template.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: arguments-artifacts-
spec:
entrypoint: entrypoint
templates:
- name: entrypoint
steps:
- - name: first-step
template: kubectl-input-artifact
arguments:
artifacts:
- name: kubectl
http:
url: https://storage.googleapis.com/kubernetes-release/release/v1.8.0/bin/linux/amd64/kubectl
- - name: second-step
template: kubectl-input-artifact
arguments:
artifacts:
- name: kubectl
http:
url: https://storage.googleapis.com/kubernetes-release/release/v1.8.0/bin/linux/amd64/kubectl
- name: kubectl-input-artifact
inputs:
artifacts:
- name: kubectl
path: /usr/local/bin/kubectl
mode: 0755
container:
image: alpine:latest
command: [sh, -c]
args: ["kubectl version"]
# Like parameters, artifacts can be "passed" to a template as well.
# In this example, the 'kubectl-input-artifact' template requires
# that an an artifact named 'kubectl' is supplied as an input,
# which it will place in /usr/local/bin/kubectl. This keeps the
# template more composable/flexible, than if the location was
# hard-wired inside the template.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: arguments-artifacts-
spec:
entrypoint: entrypoint
arguments:
artifacts:
- name: kubectl
http:
url: https://storage.googleapis.com/kubernetes-release/release/v1.8.0/bin/linux/amd64/kubectl
templates:
- name: entrypoint
steps:
- - name: first-step
template: kubectl-input-artifact
arguments:
artifacts:
- name: kubectl
from: "{workflow.artifacts.kubectl}"
- - name: second-step
template: kubectl-input-artifact
arguments:
artifacts:
- name: kubectl
from: "{workflow.artifacts.kubectl}"
- name: kubectl-input-artifact
inputs:
artifacts:
- name: kubectl
path: /usr/local/bin/kubectl
mode: 0755
container:
image: alpine:latest
command: [sh, -c]
args: ["kubectl version"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment