Skip to content

Commit 5ec0270

Browse files
authored
feat(agent): add support for new agent readiness probe (#1437)
1 parent 05748e0 commit 5ec0270

File tree

6 files changed

+139
-4
lines changed

6 files changed

+139
-4
lines changed

charts/agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ sources:
3030
- https://app.sysdigcloud.com/#/settings/user
3131
- https://github.com/draios/sysdig
3232
type: application
33-
version: 1.17.0
33+
version: 1.17.1

charts/agent/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ The following table lists the configurable parameters of the Sysdig chart and th
135135
| `daemonset.affinity` | Specifies node affinities. Overrides `daemonset.arch` and `daemonset.os` values. | `{}` |
136136
| `daemonset.annotations` | Specifies the custom annotations for daemonset. | `{}` |
137137
| `daemonset.labels` | Specifies the custom labels for daemonset as a multi-line templated string map or as YAML. | |
138-
| `daemonset.probes.initialDelay` | Specifies the initial delay for liveness and readiness probes daemonset. | `{}` |
138+
| `daemonset.probes.initialDelay` | Specifies the initial delay for the deamonset readiness probe. | `90` |
139+
| `daemonset.probes.periodDelay` | Specifies the period delay for the daemonset readiness probe. | `3` |
139140
| `daemonset.kmodule.env` | Sets the environment variables for the kernel module image builder. Provide as map of `VAR: val` | `{}` |
140141
| `slim.enabled` | Uses the slim based Sysdig Agent image. | `true` |
141142
| `slim.image.repository` | Specifies the slim agent image repository. | `sysdig/agent-slim` |

charts/agent/templates/daemonset.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,16 @@ spec:
219219
value: /opt/draios/etc/ca-certs/{{- include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl) -}}
220220
{{- end }}
221221
readinessProbe:
222+
{{- if ge (semver "12.18.0" | (semver .Values.image.tag).Compare) 0 }}
223+
httpGet:
224+
path: /healthz
225+
port: 24483
226+
{{- else }}
222227
exec:
223228
command: [ "test", "-e", "/opt/draios/logs/running" ]
229+
{{- end }}
224230
initialDelaySeconds: {{ .Values.daemonset.probes.initialDelay }}
231+
periodSeconds: {{ .Values.daemonset.probes.periodDelay }}
225232
volumeMounts:
226233
{{- if .Values.localForwarder.enabled }}
227234
- mountPath: /opt/draios/etc/local_forwarder_config.yaml

charts/agent/templates/deployment.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,16 @@ spec:
103103
value: /opt/draios/etc/ca-certs/{{- include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl) -}}
104104
{{- end }}
105105
readinessProbe:
106+
{{- if ge (semver "12.18.0" | (semver .Values.image.tag).Compare) 0 }}
107+
httpGet:
108+
path: /healthz
109+
port: 24483
110+
{{- else }}
106111
exec:
107112
command: [ "test", "-e", "/opt/draios/logs/running" ]
108-
failureThreshold: 3
113+
{{- end }}
114+
initialDelaySeconds: {{ .Values.delegatedAgentDeployment.deployment.probes.initialDelay }}
115+
periodSeconds: {{ .Values.delegatedAgentDeployment.deployment.probes.periodDelay }}
109116
terminationMessagePath: /dev/termination-log
110117
terminationMessagePolicy: File
111118
volumeMounts:
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
suite: Test the Readiness Probe Configuration
2+
templates:
3+
- templates/daemonset.yaml
4+
- templates/deployment.yaml
5+
tests:
6+
- it: "[DaemonSet] Readiness Probe (agent > 12.18.0)"
7+
set:
8+
image:
9+
tag: 12.18.1
10+
asserts:
11+
- equal:
12+
path: spec.template.spec.containers[0].readinessProbe
13+
value:
14+
httpGet:
15+
path: /healthz
16+
port: 24483
17+
initialDelaySeconds: 90
18+
periodSeconds: 3
19+
template: templates/daemonset.yaml
20+
- it: "[DaemonSet] Readiness Probe (agent == 12.18.0)"
21+
set:
22+
image:
23+
tag: 12.18.0
24+
asserts:
25+
- equal:
26+
path: spec.template.spec.containers[0].readinessProbe
27+
value:
28+
httpGet:
29+
path: /healthz
30+
port: 24483
31+
initialDelaySeconds: 90
32+
periodSeconds: 3
33+
template: templates/daemonset.yaml
34+
- it: "[DaemonSet] Readiness Probe (agent < 12.18.0)"
35+
set:
36+
image:
37+
tag: 12.16.3
38+
asserts:
39+
- equal:
40+
path: spec.template.spec.containers[0].readinessProbe
41+
value:
42+
exec:
43+
command:
44+
- test
45+
- -e
46+
- /opt/draios/logs/running
47+
initialDelaySeconds: 90
48+
periodSeconds: 3
49+
template: templates/daemonset.yaml
50+
- it: "[DelegatedAgentDeployment] Readiness Probe (agent > 12.18.0)"
51+
set:
52+
delegatedAgentDeployment:
53+
enabled: true
54+
image:
55+
tag: 12.18.1
56+
asserts:
57+
- equal:
58+
path: spec.template.spec.containers[0].readinessProbe
59+
value:
60+
httpGet:
61+
path: /healthz
62+
port: 24483
63+
initialDelaySeconds: 90
64+
periodSeconds: 3
65+
- it: "[DelegatedAgentDeployment] Readiness Probe (agent == 12.18.0)"
66+
set:
67+
delegatedAgentDeployment:
68+
enabled: true
69+
image:
70+
tag: 12.18.0
71+
asserts:
72+
- equal:
73+
path: spec.template.spec.containers[0].readinessProbe
74+
value:
75+
httpGet:
76+
path: /healthz
77+
port: 24483
78+
initialDelaySeconds: 90
79+
periodSeconds: 3
80+
- it: "[DelegatedAgentDeployment] Readiness Probe (agent < 12.18.0)"
81+
set:
82+
delegatedAgentDeployment:
83+
enabled: true
84+
image:
85+
tag: 12.16.3
86+
asserts:
87+
- equal:
88+
path: spec.template.spec.containers[0].readinessProbe
89+
value:
90+
exec:
91+
command:
92+
- test
93+
- -e
94+
- /opt/draios/logs/running
95+
initialDelaySeconds: 90
96+
periodSeconds: 3
97+
- it: Test setting probe delays
98+
set:
99+
daemonset:
100+
probes:
101+
initialDelay: 5
102+
periodDelay: 3
103+
delegatedAgentDeployment:
104+
deployment:
105+
probes:
106+
initialDelay: 5
107+
periodDelay: 3
108+
enabled: true
109+
asserts:
110+
- equal:
111+
path: spec.template.spec.containers[0].readinessProbe.initialDelaySeconds
112+
value: 5
113+
- equal:
114+
path: spec.template.spec.containers[0].readinessProbe.periodSeconds
115+
value: 3

charts/agent/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ daemonset:
145145
annotations: {}
146146
# Allow the DaemonSet to set labels
147147
labels: {}
148-
# Liveness and readiness probes initial delay (in seconds)
148+
# readiness probe delays
149149
probes:
150150
initialDelay: 90
151+
periodDelay: 3
151152
kmodule:
152153
env: {}
153154
# If is behind a proxy you can set the proxy server
@@ -305,6 +306,10 @@ delegatedAgentDeployment:
305306
os:
306307
- linux
307308
labels: {}
309+
# readiness probes delays
310+
probes:
311+
initialDelay: 90
312+
periodDelay: 3
308313
progressDeadlineSeconds: 600
309314
replicas: 1
310315
resources:

0 commit comments

Comments
 (0)