-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathpatch-cmd-probe.yaml
47 lines (43 loc) · 1.5 KB
/
patch-cmd-probe.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
# Code generated by KubeVela templates. DO NOT EDIT.
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: "A Probe detect the pod status by executing command."
name: patch-cmd-probe
spec:
appliesToWorkloads:
- microservice
schematic:
cue:
template: |-
patch: {
spec: template: spec: {
// +patchKey=name
containers: [{
name: context.name
readinessProbe: {
initialDelaySeconds: parameter.readinessProbe.waitServiceStartUpSeconds
periodSeconds: parameter.readinessProbe.periodSeconds
exec: command: parameter.readinessProbe.cmd
}
livenessProbe: {
initialDelaySeconds: parameter.livenessProbe.waitServiceStartUpSeconds
periodSeconds: parameter.livenessProbe.periodSeconds
exec: command: parameter.livenessProbe.cmd
}
}]
}
}
#ProbeAction: {
// +usage=Number of seconds after the container has started before liveness probes are initiated
waitServiceStartUpSeconds: *20 | int
// +usage=How often (in seconds) to perform the probe
periodSeconds: *10 | int
// +usage=Command is the command line to execute inside the container
cmd: [...string]
}
parameter: {
readinessProbe: #ProbeAction
livenessProbe: #ProbeAction
}