-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdisposablerequest.yaml
55 lines (50 loc) · 2.01 KB
/
disposablerequest.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
apiVersion: http.crossplane.io/v1alpha2
kind: DisposableRequest
metadata:
name: send-notification
spec:
deletionPolicy: Orphan
forProvider:
# Injecting data from secrets is possible, simply use the following syntax: {{ name:namespace:key }} (supported for body and headers only)
url: http://flask-api.default.svc.cluster.local/v1/notify
method: POST
body: |
{
"recipient": "[email protected]",
"subject": "Alert",
"message": "Your action is required immediately."
}
headers:
Content-Type:
- application/json
Authorization:
- "Bearer {{ auth:default:token }}"
insecureSkipTLSVerify: true
# The 'expectedResponse' field is optional. If used, also set 'rollbackRetriesLimit', which determines the number of HTTP requests to be sent until the jq query returns true.
expectedResponse: '.body.status == "sent"'
rollbackRetriesLimit: 5
waitTimeout: 5m
# Indicates whether the reconciliation should loop indefinitely. If `rollbackRetriesLimit` is set and the request returns an error, it will stop reconciliation once the limit is reached.
# shouldLoopInfinitely: true
# Specifies the duration after which the next reconcile should occur.
# nextReconcile: 3m
# Secrets receiving patches from response data
secretInjectionConfigs:
- secretRef:
name: notification-response
namespace: default
metadata:
labels:
status: .body.status
annotations:
key: value
keyMappings:
- secretKey: notification-status
responseJQ: .body.status
- secretKey: notification-id
responseJQ: .body.id
# setOwnerReference determines if the secret should be deleted when the associated resource is deleted.
setOwnerReference: true
providerConfigRef:
name: http-conf
# TODO: check if it's possible to modify the deletionPolicy to be orphan by default.