Skip to content

Instantly share code, notes, and snippets.

@xmnlab
Last active February 16, 2021 15:41
Show Gist options
  • Save xmnlab/6b18a00e83e568ba3eb5a84cbc08d66d to your computer and use it in GitHub Desktop.
Save xmnlab/6b18a00e83e568ba3eb5a84cbc08d66d to your computer and use it in GitHub Desktop.
argo example
# refs:
# - https://github.com/argoproj/argo-workflows/issues/4038#issuecomment-692904824
# - https://raw.githubusercontent.com/argoproj/argo/master/examples/hello-world.yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: titanic-wf-
labels:
workflows.argoproj.io/archive-strategy: "false"
spec:
entrypoint: main
templates:
- name: main
steps:
- - name: generate-artifact
template: load-data
- name: load-data
container:
image: busybox
command: ["/bin/sh", "-c"]
args: ["wget https://gist.githubusercontent.com/michhar/2dfd2de0d4f8727f873422c5d959fff5/raw/fa71405126017e6a37bea592440b4bee94bf7b9e/titanic.csv -O /mnt/smb/titanic.csv"]
volumeMounts:
- name: smb
mountPath: "/mnt/smb"
readOnly: false
volumes:
- name: smb
persistentVolumeClaim:
claimName: windows-pvc
argo submit -n argo --serviceaccount default --log --loglevel debug -v --watch workflows/argo-workflow.yaml
DEBU[2021-02-16T10:25:14.564Z] CLI version version="{v2.12.6 2021-01-25T20:03:12Z 4cb5b7eb807573e167f3429fb5fc8bf5ade0685d v2.12.6 clean go1.13 gc linux/amd64}"
DEBU[2021-02-16T10:25:14.564Z] Client options opts="(argoServerOpts=(url=,path=,secure=false,insecureSkipVerify=false,http=false),instanceID=)"
I0216 10:25:14.567081 813067 loader.go:375] Config loaded from file: /home/xmn/.kube/config
DEBU[2021-02-16T10:25:14.588Z] Getting the template by name
DEBU[2021-02-16T10:25:14.588Z] Resolving the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (main)"
DEBU[2021-02-16T10:25:14.588Z] Getting the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (main)"
DEBU[2021-02-16T10:25:14.588Z] Getting the template by name base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (main)"
DEBU[2021-02-16T10:25:14.589Z] Getting the template by name
DEBU[2021-02-16T10:25:14.590Z] Resolving the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template by name base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template by name base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.590Z] Resolving the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template by name base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template by name base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (main)"
DEBU[2021-02-16T10:25:14.590Z] Resolving the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (main)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (main)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template by name base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (main)"
DEBU[2021-02-16T10:25:14.590Z] Getting the template by name base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (main)"
DEBU[2021-02-16T10:25:14.591Z] Resolving the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.591Z] Getting the template base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
DEBU[2021-02-16T10:25:14.591Z] Getting the template by name base="*v1alpha1.Workflow (namespace=argo,name=)" depth=0 tmpl="*v1alpha1.WorkflowStep (load-data)"
I0216 10:25:14.635902 813067 round_trippers.go:443] POST https://192.168.49.2:8443/apis/argoproj.io/v1alpha1/namespaces/argo/workflows 201 Created in 44 milliseconds
Name: titanic-wf65cmv
Namespace: argo
ServiceAccount: default
Status: Pending
Created: Tue Feb 16 10:25:14 -0400 (now)
Progress:
I0216 10:25:14.668596 813067 round_trippers.go:443] GET https://192.168.49.2:8443/apis/argoproj.io/v1alpha1/namespaces/argo/workflows/titanic-wf65cmv 200 OK in 3 milliseconds
I0216 10:25:14.687019 813067 round_trippers.go:443] GET https://192.168.49.2:8443/apis/argoproj.io/v1alpha1/namespaces/argo/workflows/titanic-wf65cmv 200 OK in 13 milliseconds
DEBU[2021-02-16T10:25:14.687Z] List options namespace=argo options="{{ } workflows.argoproj.io/workflow=titanic-wf65cmv false false <nil> 0 }" workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:14.687Z] Log options namespace=argo options="&PodLogOptions{Container:main,Follow:true,Previous:false,SinceSeconds:nil,SinceTime:<nil>,Timestamps:false,TailLines:nil,LimitBytes:nil,InsecureSkipTLSVerifyBackend:false,}" workflow=titanic-wf65cmv
I0216 10:25:14.693265 813067 round_trippers.go:443] GET https://192.168.49.2:8443/api/v1/namespaces/argo/pods?labelSelector=workflows.argoproj.io%2Fworkflow%3Dtitanic-wf65cmv&watch=true 200 OK in 1 milliseconds
DEBU[2021-02-16T10:25:14.693Z] Listing workflow pods namespace=argo workflow=titanic-wf65cmv
I0216 10:25:14.702016 813067 round_trippers.go:443] GET https://192.168.49.2:8443/api/v1/namespaces/argo/pods?labelSelector=workflows.argoproj.io%2Fworkflow%3Dtitanic-wf65cmv 200 OK in 8 milliseconds
I0216 10:25:14.771018 813067 round_trippers.go:443] GET https://192.168.49.2:8443/apis/argoproj.io/v1alpha1/namespaces/argo/workflows?fieldSelector=metadata.name%3Dtitanic-wf65cmv&resourceVersion=0&watch=true 200 OK in 2 milliseconds
DEBU[2021-02-16T10:25:14.771Z] Waiting for work-group namespace=argo workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:14.771Z] Sorting entries namespace=argo workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:14.771Z] Watching for workflow events namespace=argo workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:14.771Z] Watching for pod events namespace=argo workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:14.772Z] Workflow event completed=false eventType=ADDED namespace=argo workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:14.775Z] Pod event eventType=ADDED namespace=argo phase=Pending podName=titanic-wf65cmv-3525859734 workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:14.796Z] Pod event eventType=MODIFIED namespace=argo phase=Pending podName=titanic-wf65cmv-3525859734 workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:14.863Z] Pod event eventType=MODIFIED namespace=argo phase=Pending podName=titanic-wf65cmv-3525859734 workflow=titanic-wf65cmv
DEBU[2021-02-16T10:25:24.780Z] Workflow event completed=false eventType=MODIFIED namespace=argo workflow=titanic-wf65cmv
apiVersion: v1
kind: PersistentVolume
metadata:
name: windows-pv
spec:
capacity:
storage: 100Mi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
mountOptions:
- dir_mode=0755
- file_mode=0644
- noperm
- vers=3.0
- domain=localhost
csi:
driver: smb.csi.k8s.io
readOnly: false
volumeHandle: windows-pv-handle # make sure it's a unique id in the cluster
volumeAttributes:
source: "//192.168.0.16/ftp"
nodeStageSecretRef:
name: xmn
namespace: mypassword
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: windows-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Mi
volumeName: windows-pv
storageClassName: ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment