feat: translate docker-options --sysctl on the k3s scheduler

The `docker-local` scheduler supports `--sysctl` for free because docker options are passed verbatim to `docker run`, but the k3s scheduler silently dropped it. Namespaced sysctls now render into the pod's `securityContext.sysctls` for deployments, cron jobs, and one-off runs. A sysctl the kernel does not namespace fails the deploy instead of being dropped, since it cannot take effect within a pod regardless of what was requested.
This commit is contained in:
Jose Diaz-Gonzalez
2026-08-07 02:38:46 -04:00
parent f050726f1a
commit cd1089500b
9 changed files with 530 additions and 0 deletions

View File

@@ -73,6 +73,14 @@ spec:
{{ include "print.labels" (dict "config" $.Values.global "key" "pod") | indent 12 }}
{{ include "print.labels" (dict "config" $config "key" "pod") | indent 12 }}
spec:
{{- if and (hasKey $.Values.global "security_context") $.Values.global.security_context.sysctls }}
securityContext:
sysctls:
{{- range $.Values.global.security_context.sysctls }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- end }}
containers:
- args:
{{- range $config.args }}

View File

@@ -58,6 +58,14 @@ spec:
{{ include "print.labels" (dict "config" $.Values.global "key" "pod") | indent 8 }}
{{ include "print.labels" (dict "config" $config "key" "pod") | indent 8 }}
spec:
{{- if and (hasKey $.Values.global "security_context") $.Values.global.security_context.sysctls }}
securityContext:
sysctls:
{{- range $.Values.global.security_context.sysctls }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- end }}
containers:
- args:
{{- range $config.args }}