How to set capabilities for a container in cdk8s?

121 Views Asked by At

In YAML I'd do this:

securityContext:
    capabilities:
        add:
            - NET_ADMIN

Example in k8: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-capabilities-for-a-container

How do I achieve this with ckd8s?

1

There are 1 best solutions below

0
On

This isn't currently possible.

From https://github.com/cdk8s-team/cdk8s-plus/issues/1168:

Capabilities are not yet supported by cdk8s-plus, so escape hatches are the way to go.