Kubernetes manifests · Workloads

Harden a container

Run as a non-root user with a read-only filesystem and no extra privileges.

securityContext:
  runAsNonRoot: true
  runAsUser: 10001
  readOnlyRootFilesystem: true
  allowPrivilegeEscalation: false
  capabilities:
    drop: ["ALL"]

Official Kubernetes manifests documentation

More workloads commands

All workloads commands · Kubernetes manifests cheatsheet

Was this page helpful?