Repository navigation
Description
Why?
Clusters that enforce the restricted Pod Security Standard (e.g. CERIT-SC, where every namespace is restricted) refuse every task: tesk-api builds the taskmaster's Job from its built-in taskmaster.json, which has no security context, and gives executors only a pod-level runAsUser, runAsGroup, fsGroup and runAsNonRoot (ConfigMap named by CONFIGMAP). Neither pod gets seccompProfile, allowPrivilegeEscalation: false or capabilities.drop: [ALL]. The taskmaster's Job is created, its pod never is, and the task stays QUEUED for ever:
Error creating: pods "task-…" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "task-…" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (…), runAsNonRoot != true (…), seccompProfile (…)
(kind, Kubernetes 1.37, namespace with pod-security.kubernetes.io/enforce=restricted, TESK chart 0.4.0: API and filer pods admitted, 4 of 4 tasks stuck in QUEUED.) The API's pod and the filer pods (taskmaster 0.12.0) are already restricted-ready, so only these two are left.
How?
- Taskmaster pods: a pod and a container security context from settings (JSON objects, as the filer's
FILER_POD_SECURITY_CONTEXT/FILER_SECURITY_CONTEXTin taskmaster 0.12.0). Default: none, as today, because aRuntimeDefaultdefault would break clusters that refuse it (CSC Rahti); the docs give the restricted set (runAsNonRoot: true,seccompProfile: RuntimeDefault; containerallowPrivilegeEscalation: false,capabilities.drop: [ALL]; the image runs as UID 100). - Executor pods: the same two contexts from settings, on top of today's four fields (keep reading the old ConfigMap keys for compatibility); default: as today, so restricted clusters opt in.
- Tests for both, including the empty-object and invalid-value cases; docs of the new settings.
- Follow-up in TESK: chart values
tesk.taskmaster.podSecurityContext/securityContextandtesk.executor.podSecurityContext/securityContext, docs ("Restricted clusters"), and a smoke test in arestrictedkind namespace.
Acceptance criteria
- With the new settings, a task with an input and an output completes in a namespace that enforces
restricted. - Without them, taskmaster and executor pods look exactly as in 2.0.0.
- Settings documented; tests cover defaults, overrides and invalid values.
Also: resource limits (same pods)
Namespaces with a ResourceQuota on limits.cpu (CERIT-SC again: hard: {"limits.cpu": "100"}) refuse every container without a CPU limit (failed quota: …: must specify limits.cpu for: …). tesk-api gives the taskmaster no resources at all, and executors a CPU limit only when the task sets resources.cpu_cores.
- Taskmaster pods: requests and limits from settings, with small defaults (e.g. CPU 100m/500m, memory 128Mi/256Mi; measure the real need), so they're admitted under a CPU quota out of the box.
- Executor pods: when the task sets no
cpu_cores, a configurable default CPU request and limit (e.g. 1); when it setsram_gb, the memory limit equals the request (see fix: give executors a memory limit when they set CPUs tesk-core#160 for the taskmaster's side). - Acceptance: in a namespace with
restrictedand alimits.cpuquota, a task with an input and an output completes; defaults and overrides are tested and documented.
Seen at CERIT-SC with server-side dry runs on 2026-11-21: the filer pod was refused by the quota, the taskmaster and executor pods by Pod Security restricted. Needed for elixir-cloud-aai/generic-issues#122.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity