forked from jp-gouin/helm-openldap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.argo-workflow.yaml
133 lines (132 loc) · 4.61 KB
/
.argo-workflow.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: openldap-qualif-
spec:
entrypoint: test-deployment
arguments:
parameters:
- name: namespace
value: openldap-qualif
- name: app
value: openldap-qualif
# This spec contains two templates: hello-hello-hello and whalesay
templates:
- name: test-deployment
parallelism: 1
# Instead of just running a container
# This template has a sequence of steps
steps:
- - name: wait-upgrade # hello1 is run before the following steps
template: wait-upgrade
arguments:
parameters:
- name: time
value: 10
- name: type
value: sts
- - name: test-openldap-upgrade # double dash => run after previous step
template: test-openldap-upgrade
arguments:
parameters:
- name: url
value: "{{workflow.parameters.app}}.{{workflow.parameters.namespace}}"
- name: password
value: "Not@SecurePassw0rd"
- name: user
value: "cn=admin,dc=example,dc=org"
- name: occurence
value: "{{item}}"
withSequence:
count: "1"
- - name: apply-chaos-test # double dash => run after previous step
template: apply-chaos-test
- - name: test-openldap # double dash => run after previous step
template: test-openldap-upgrade
arguments:
parameters:
- name: url
value: "{{workflow.parameters.app}}.{{workflow.parameters.namespace}}"
- name: password
value: "Not@SecurePassw0rd"
- name: user
value: "cn=admin,dc=example,dc=org"
- name: occurence
value: "{{item}}"
withSequence:
count: "60"
- - name: cleanup # double dash => run after previous step
template: pause-chaos-test
# This is the same template as from the previous example
- name: wait-upgrade
serviceAccountName: argo-workflow-invocator
inputs:
parameters:
- name: time
- name: type # type of resources to wait (deployement or sts)
script:
image: bitnami/kubectl:1.18.13
command: [/bin/bash]
source: |
sleep {{inputs.parameters.time}}
kubectl rollout status -n {{workflow.parameters.namespace}} {{inputs.parameters.type}} {{workflow.parameters.app}}
- name: test-openldap-upgrade
serviceAccountName: argo-workflow-invocator
inputs:
parameters:
- name: url
- name: password
- name: user
- name: occurence
script:
image: alpine
command: [sh]
source: | # Contents of the here-script
apk add openldap-clients
echo "run ldap commands (add, search, modify...)"
LDAPTLS_REQCERT=never ldapsearch -x -D '{{inputs.parameters.user}}' -w {{inputs.parameters.password}} -H ldaps://{{inputs.parameters.url}} -b 'dc=example,dc=org'
sleep 60
- name: apply-chaos-test
serviceAccountName: argo-workflow-invocator
resource: # indicates that this is a resource template
action: apply # can be any kubectl action (e.g. create, delete, apply, patch)
manifest: | #put your kubernetes spec here
apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
name: pod-failure-openldap
namespace: openldap-qualif
annotations:
experiment.chaos-mesh.org/pause: "false"
spec:
action: pod-failure
mode: random-max-percent
value: "100"
duration: "15s"
selector:
labelSelectors:
"app": "openldap-qualif"
scheduler:
cron: "@every 2m"
- name: pause-chaos-test
serviceAccountName: argo-workflow-invocator
resource: # indicates that this is a resource template
action: apply # can be any kubectl action (e.g. create, delete, apply, patch)
manifest: | #put your kubernetes spec here
apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
name: pod-failure-openldap
namespace: openldap-qualif
annotations:
experiment.chaos-mesh.org/pause: "true"
spec:
action: pod-failure
mode: random-max-percent
value: "100"
duration: "15s"
selector:
labelSelectors:
"app": "openldap-qualif"
scheduler:
cron: "@every 2m"