Skip to content

feat: make task pods restricted-ready #209

Closed

Description

@uniqueg

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?

  1. Taskmaster pods: a pod and a container security context from settings (JSON objects, as the filer's FILER_POD_SECURITY_CONTEXT/FILER_SECURITY_CONTEXT in taskmaster 0.12.0). Default: none, as today, because a RuntimeDefault default would break clusters that refuse it (CSC Rahti); the docs give the restricted set (runAsNonRoot: true, seccompProfile: RuntimeDefault; container allowPrivilegeEscalation: false, capabilities.drop: [ALL]; the image runs as UID 100).
  2. 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.
  3. Tests for both, including the empty-object and invalid-value cases; docs of the new settings.
  4. Follow-up in TESK: chart values tesk.taskmaster.podSecurityContext/securityContext and tesk.executor.podSecurityContext/securityContext, docs ("Restricted clusters"), and a smoke test in a restricted kind 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 sets ram_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 restricted and a limits.cpu quota, 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.

Activity

  1. self-assigned this
    on Nov 21, 2026
  2. added
    type: feature
    priority: high
    status: in progress
    workload: days
    ecp-wp4: M4.4
    on Nov 21, 2026
  3. moved this from Backlog to In progress in ELIXIR On-Cloudon Nov 21, 2026
  4. moved this from In progress to Done in ELIXIR On-Cloudon Nov 21, 2026
  5. added this to the v2.1.0 milestone on Nov 22, 2026
  6. removed
    status: in progress
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ecp-wp4: M4.4priority: hightype: featureworkload: days

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions