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:
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user