Skip to content

Allow configuration of ContainerSecurityContext for XCom Sidecar (KubernetesPodOperator) #49276

@DjVinnii

Description

@DjVinnii

Description

Allow configuring the Container Security Context for the XCom sidecar. It would be great if this can be set with a default the Airflow Deployment Managers and if needed overridden by the Dag Authors.

Use case/motivation

It might be impossible to use the XCom sidecar when using the KubernetesPodOperator in a strictly regulated environment with for example OPA policies. It is for example not possible to configure the Container Security Context for the ingested sidecar when certain Container Security Context settings are expected such as the error bellow mentions:

HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"admission webhook \"validation.gatekeeper.sh\" denied the request: [deny-privilege-escalation] Privilege escalation in container is not allowed: airflow-xcom-sidecar\n[ro-rootfs-constraint] Read-only root filesystem is required: airflow-xcom-sidecar\n[k8sseccomp] Seccomp profile 'not configured' is not allowed for container 'airflow-xcom-sidecar'. Found at: no explicit profile found. Allowed profiles: {\"RuntimeDefault\", \"docker/default\", \"runtime/default\"}","reason":"Forbidden","code":403}

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions