forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
daemon-step.yaml
64 lines (59 loc) · 1.94 KB
/
daemon-step.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
apiVersion: argoproj.io/v1alpha1
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
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}}"]