Skip to content

Commit 922e285

Browse files
author
Michael Chmielewski
committed
Update container daemon logic and extend liveness probe period
Starting in agent 2.4.0, the agent will attempt to detect which container daemon services are running. So the two existing settings are now to override this behavior explicitly.
1 parent e95a070 commit 922e285

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ The following kubernetes objects are created when the chart is installed:
5353
| daemonset.customAuditRules | string | `""` | |
5454
| daemonset.customLuaFilter | string | `""` | |
5555
| daemonset.customTsAuditdConfig | string | `""` | |
56-
| daemonset.enableContainerd | bool | `false` | Defaults to `false`, configures the daemonset agents to listen to the containerd daemon socket |
57-
| daemonset.enableDocker | bool | `true` | Defaults to `true`, configures the daemonset agents to listen to the docker daemon socket |
56+
| daemonset.enableContainerd | bool | `unset` | Configures the daemonset agents to listen to the containerd daemon socket. **By default in agent 2.4.0+, the agent detects if containerd is running at startup** |
57+
| daemonset.enableDocker | bool | `unset` | Configures the daemonset agents to listen to the docker daemon socket. **By default in agent 2.4.0+, the agent detects if docker is running at startup** |
5858
| daemonset.nodeSelector | object | `{}` | |
5959
| daemonset.podAnnotations."container.apparmor.security.beta.kubernetes.io/threatstack-agent" | string | `"unconfined"` | |
6060
| daemonset.priorityClassName | string | `""` | Optionally set the priority class name for the daemonset pods. Note that priority classes are not created via this helm chart. Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ |

templates/_helpers.tpl

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,29 @@ Create chart name and version as used by the chart label.
3232
{{- end -}}
3333

3434
{{/*
35-
Return runtime config if docker enabled
35+
Return runtime config if docker is disabled
3636
*/}}
3737
{{- define "threatstack-agent.docker-config" -}}
38-
{{- if .Values.daemonset.enableDocker -}}
38+
{{- if kindIs "invalid" .Values.daemonset.enableDocker -}}
39+
{{- else -}}
40+
{{- if eq .Values.daemonset.enableDocker false -}}
41+
{{- default "container_runtimes.docker.enabled false container_runtimes.docker.kubernetes_enabled false" -}}
42+
{{- else -}}
3943
{{- default "container_runtimes.docker.enabled true container_runtimes.docker.kubernetes_enabled true" -}}
4044
{{- end -}}
4145
{{- end -}}
46+
{{- end -}}
4247

4348
{{/*
44-
Return runtime config if containerd enabled
49+
Return runtime config if containerd is disabled
4550
*/}}
4651
{{- define "threatstack-agent.containerd-config" -}}
47-
{{- if .Values.daemonset.enableContainerd -}}
52+
{{- if kindIs "invalid" .Values.daemonset.enableContainerd -}}
53+
{{- else -}}
54+
{{- if eq .Values.daemonset.enableContainerd false -}}
55+
{{- default "container_runtimes.containerd.enabled false container_runtimes.containerd.kubernetes_enabled false" -}}
56+
{{- else -}}
4857
{{- default "container_runtimes.containerd.enabled true container_runtimes.containerd.kubernetes_enabled true" -}}
4958
{{- end -}}
5059
{{- end -}}
60+
{{- end -}}

templates/daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ spec:
7676
exec:
7777
command: [ "sh", "-c", "tsagent status" ]
7878
initialDelaySeconds: 15
79-
periodSeconds: 60
79+
periodSeconds: 360
8080
timeoutSeconds: 5
8181
successThreshold: 1
8282
failureThreshold: 5

templates/deployment-api-reader.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
exec:
6060
command: [ "sh", "-c", "tsagent status" ]
6161
initialDelaySeconds: 15
62-
periodSeconds: 60
62+
periodSeconds: 360
6363
timeoutSeconds: 5
6464
successThreshold: 1
6565
failureThreshold: 5

values.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,11 @@ apiReader:
145145
#
146146
########
147147
daemonset:
148-
enableDocker: true
149-
enableContainerd: false
148+
# Override the agent's default detection behavior that determines
149+
# which docker service to monitor
150+
#
151+
# enableDocker: false
152+
# enableContainerd: false
150153

151154
additionalRuntimeConfig: "log.level info"
152155
# Override the agent's liveness probe logic from the default:

0 commit comments

Comments
 (0)