kubectl create -f - << EOFapiVersion:argoproj.io/v1alpha1kind:Workflowmetadata:generateName:steps-spec:entrypoint:hello # We reference our first "template" heretemplates:- name:hello # The first "template" in this Workflow, it is referenced by "entrypoint"steps:# The type of this "template" is "steps"- - name:hellotemplate:whalesay # We reference our second "template" herearguments:parameters:[{name: message, value:"Hello ArgoWorkflow!"}]- name:whalesay # The second "template" in this Workflow, it is referenced by "hello"inputs:parameters:- name:messagecontainer:# The type of this "template" is "container"image:docker/whalesaycommand:[cowsay]args:["{{inputs.parameters.message}}"]EOF
功能也很简单,就是打印 Hello ArgoWorkflow! 这句话。
查看状态
1
2
3
[root@argo ~]# kubectl get workflowNAME STATUS AGE MESSAGE
steps-75xmq Running 6s
[root@argo ~]# kubectl get po -wNAME READY STATUS RESTARTS AGE
steps-75xmq-whalesay-1542601109 0/2 PodInitializing 0 96s
看起来正在拉取镜像,等一下
1
2
3
4
5
6
[root@argo ~]# kubectl get poNAME READY STATUS RESTARTS AGE
steps-75xmq-whalesay-1542601109 0/2 Completed 0 2m58s
[root@argo ~]# kubectl get workflowNAME STATUS AGE MESSAGE
steps-75xmq Succeeded 3m6s
Pod 已经运行完成了,Workflow 也进行 Successed 状态,查看 Pod 日志,确认是否真的执行了