forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for daemon workflow steps (no termination yet)
- Loading branch information
Showing
6 changed files
with
158 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
apiVersion: argoproj.io/v1 | ||
kind: Workflow | ||
metadata: | ||
generateName: daemon-step- | ||
spec: | ||
entrypoint: daemon-example | ||
templates: | ||
- name: daemon-example | ||
steps: | ||
- - name: influx | ||
template: influxdb | ||
|
||
- - name: init-database | ||
template: influxdb-client | ||
arguments: | ||
parameters: | ||
- name: cmd | ||
value: curl -XPOST 'http:https://{{steps.influx.ip}}:8086/query' --data-urlencode "q=CREATE DATABASE mydb" | ||
|
||
- - name: producer-1 | ||
template: influxdb-client | ||
arguments: | ||
parameters: | ||
- name: cmd | ||
value: for i in $(seq 1 20); do curl -XPOST 'http:https://{{steps.influx.ip}}:8086/write?db=mydb' -d "cpu,host=server01,region=uswest load=$i" ; sleep .5 ; done | ||
- name: producer-2 | ||
template: influxdb-client | ||
arguments: | ||
parameters: | ||
- name: cmd | ||
value: for i in $(seq 1 20); do curl -XPOST 'http:https://{{steps.influx.ip}}:8086/write?db=mydb' -d "cpu,host=server02,region=uswest load=$((RANDOM % 100))" ; sleep .5 ; done | ||
- name: producer-3 | ||
template: influxdb-client | ||
arguments: | ||
parameters: | ||
- name: cmd | ||
value: curl -XPOST 'http:https://{{steps.influx.ip}}:8086/write?db=mydb' -d 'cpu,host=server03,region=useast load=15.4' | ||
|
||
- - name: consumer | ||
template: influxdb-client | ||
arguments: | ||
parameters: | ||
- name: cmd | ||
value: curl --silent -G http:https://{{steps.influx.ip}}:8086/query?pretty=true --data-urlencode "db=mydb" --data-urlencode "q=SELECT * FROM cpu" | ||
|
||
- name: influxdb | ||
daemon: true | ||
container: | ||
image: influxdb:1.2 | ||
restartPolicy: Always | ||
readinessProbe: | ||
httpGet: | ||
path: /ping | ||
port: 8086 | ||
initialDelaySeconds: 5 | ||
timeoutSeconds: 1 | ||
|
||
- name: influxdb-client | ||
inputs: | ||
parameters: | ||
- name: cmd | ||
container: | ||
image: appropriate/curl:latest | ||
command: ["sh", "-c"] | ||
args: ["{{inputs.parameters.cmd}}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters