diff --git a/charts/agent/Chart.yaml b/charts/agent/Chart.yaml index d2338521a..dd27c1828 100644 --- a/charts/agent/Chart.yaml +++ b/charts/agent/Chart.yaml @@ -30,4 +30,4 @@ sources: - https://app.sysdigcloud.com/#/settings/user - https://github.com/draios/sysdig type: application -version: 1.15.1 +version: 1.15.2 diff --git a/charts/agent/README.md b/charts/agent/README.md index 2cdd8ae9a..00ea5a02c 100644 --- a/charts/agent/README.md +++ b/charts/agent/README.md @@ -135,7 +135,8 @@ The following table lists the configurable parameters of the Sysdig chart and th | `daemonset.affinity` | Specifies node affinities. Overrides `daemonset.arch` and `daemonset.os` values. | `{}` | | `daemonset.annotations` | Specifies the custom annotations for daemonset. | `{}` | | `daemonset.labels` | Specifies the custom labels for daemonset as a multi-line templated string map or as YAML. | | -| `daemonset.probes.initialDelay` | Specifies the initial delay for liveness and readiness probes daemonset. | `{}` | +| `daemonset.probes.initialDelay` | Specifies the initial delay for the deamonset readiness probe. | `90` | +| `daemonset.probes.periodDelay` | Specifies the period delay for the daemonset readiness probe. | `3` | | `daemonset.kmodule.env` | Sets the environment variables for the kernel module image builder. Provide as map of `VAR: val` | `{}` | | `slim.enabled` | Uses the slim based Sysdig Agent image. | `true` | | `slim.image.repository` | Specifies the slim agent image repository. | `sysdig/agent-slim` | diff --git a/charts/agent/templates/daemonset.yaml b/charts/agent/templates/daemonset.yaml index 368c11c05..f19a28437 100644 --- a/charts/agent/templates/daemonset.yaml +++ b/charts/agent/templates/daemonset.yaml @@ -219,9 +219,16 @@ spec: value: /opt/draios/etc/ca-certs/{{- include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl) -}} {{- end }} readinessProbe: + {{- if ge (semver "12.17.0" | (semver .Values.image.tag).Compare) 0 }} + httpGet: + path: /healthz + port: 24483 + {{- else }} exec: command: [ "test", "-e", "/opt/draios/logs/running" ] + {{- end }} initialDelaySeconds: {{ .Values.daemonset.probes.initialDelay }} + periodDelaySeconds: {{ .Values.daemonset.probes.periodDelay }} volumeMounts: {{- /* Always requested */}} - mountPath: /host/dev diff --git a/charts/agent/templates/deployment.yaml b/charts/agent/templates/deployment.yaml index 191659247..52e8c9b96 100644 --- a/charts/agent/templates/deployment.yaml +++ b/charts/agent/templates/deployment.yaml @@ -103,9 +103,16 @@ spec: value: /opt/draios/etc/ca-certs/{{- include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl) -}} {{- end }} readinessProbe: + {{- if ge (semver "12.17.0" | (semver .Values.image.tag).Compare) 0 }} + httpGet: + path: /healthz + port: 24483 + {{- else }} exec: command: [ "test", "-e", "/opt/draios/logs/running" ] - failureThreshold: 3 + {{- end }} + initialDelaySeconds: {{ .Values.delegatedAgentDeployment.deployment.probes.initialDelay }} + periodDelaySeconds: {{ .Values.delegatedAgentDeployment.deployment.probes.periodDelay }} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: diff --git a/charts/agent/tests/readiness_probe_test.yaml b/charts/agent/tests/readiness_probe_test.yaml new file mode 100644 index 000000000..3efc51051 --- /dev/null +++ b/charts/agent/tests/readiness_probe_test.yaml @@ -0,0 +1,115 @@ +suite: Test the Readiness Probe Configuration +templates: + - templates/daemonset.yaml + - templates/deployment.yaml +tests: + - it: "[DaemonSet] Readiness Probe (agent > 12.17.0)" + set: + image: + tag: 12.17.1 + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + httpGet: + path: /healthz + port: 24483 + initialDelaySeconds: 90 + periodDelaySeconds: 3 + template: templates/daemonset.yaml + - it: "[DaemonSet] Readiness Probe (agent == 12.17.0)" + set: + image: + tag: 12.17.0 + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + httpGet: + path: /healthz + port: 24483 + initialDelaySeconds: 90 + periodDelaySeconds: 3 + template: templates/daemonset.yaml + - it: "[DaemonSet] Readiness Probe (agent < 12.17.0)" + set: + image: + tag: 12.16.3 + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + exec: + command: + - test + - -e + - /opt/draios/logs/running + initialDelaySeconds: 90 + periodDelaySeconds: 3 + template: templates/daemonset.yaml + - it: "[DelegatedAgentDeployment] Readiness Probe (agent > 12.17.0)" + set: + delegatedAgentDeployment: + enabled: true + image: + tag: 12.17.1 + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + httpGet: + path: /healthz + port: 24483 + initialDelaySeconds: 90 + periodDelaySeconds: 3 + - it: "[DelegatedAgentDeployment] Readiness Probe (agent == 12.17.0)" + set: + delegatedAgentDeployment: + enabled: true + image: + tag: 12.17.0 + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + httpGet: + path: /healthz + port: 24483 + initialDelaySeconds: 90 + periodDelaySeconds: 3 + - it: "[DelegatedAgentDeployment] Readiness Probe (agent < 12.17.0)" + set: + delegatedAgentDeployment: + enabled: true + image: + tag: 12.16.3 + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + exec: + command: + - test + - -e + - /opt/draios/logs/running + initialDelaySeconds: 90 + periodDelaySeconds: 3 + - it: Test setting probe delays + set: + daemonset: + probes: + initialDelay: 5 + periodDelay: 3 + delegatedAgentDeployment: + deployment: + probes: + initialDelay: 5 + periodDelay: 3 + enabled: true + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe.initialDelaySeconds + value: 5 + - equal: + path: spec.template.spec.containers[0].readinessProbe.periodDelaySeconds + value: 3 diff --git a/charts/agent/values.yaml b/charts/agent/values.yaml index 7a1c13d04..0216332e3 100644 --- a/charts/agent/values.yaml +++ b/charts/agent/values.yaml @@ -145,9 +145,10 @@ daemonset: annotations: {} # Allow the DaemonSet to set labels labels: {} - # Liveness and readiness probes initial delay (in seconds) + # readiness probe delays probes: initialDelay: 90 + periodDelay: 3 kmodule: env: {} # If is behind a proxy you can set the proxy server @@ -299,6 +300,10 @@ delegatedAgentDeployment: os: - linux labels: {} + # readiness probes delays + probes: + initialDelay: 90 + periodDelay: 3 progressDeadlineSeconds: 600 replicas: 1 resources: