Skip to content

Security Context

Appears in

  • .Values.workload.$name.podSpec.containers.$name
  • .Values.workload.$name.podSpec.initContainers.$name

securityContext

Define securityContext for the container

Keyworkload.$name.podSpec.containers.$name.securityContext
Typemap
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext: {}

securityContext.runAsUser

Define the runAsUser for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.runAsUser
Typeint
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
runAsUser: 568

securityContext.runAsGroup

Define the runAsGroup for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.runAsGroup
Typeint
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
runAsGroup: 568

securityContext.readOnlyRootFilesystem

Define the readOnlyRootFilesystem for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.readOnlyRootFilesystem
Typebool
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
readOnlyRootFilesystem: true

securityContext.allowPrivilegeEscalation

Define the allowPrivilegeEscalation for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.allowPrivilegeEscalation
Typebool
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
allowPrivilegeEscalation: false

securityContext.privileged

Define the privileged for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.privileged
Typebool
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
privileged: false

securityContext.runAsNonRoot

Define the runAsNonRoot for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.runAsNonRoot
Typebool
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
runAsNonRoot: true

securityContext.capabilities

Define the capabilities for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.capabilities
Typemap
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
capabilities: {}

securityContext.capabilities.add

Define the capabilities.add for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.capabilities.add
Typelist of string
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
capabilities:
add: []

securityContext.capabilities.drop

Define the capabilities.drop for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.capabilities.drop
Typelist of string
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
capabilities:
drop: []

securityContext.seccompProfile

Define the seccompProfile for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.seccompProfile
Typemap
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
seccompProfile: {}

securityContext.seccompProfile.type

Define the seccompProfile.type for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.seccompProfile.type
Typestring
Required
Helm tpl
DefaultSee here

Valid Values:

  • RuntimeDefault
  • Localhost
  • Unconfined

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
seccompProfile:
type: Localhost

securityContext.seccompProfile.profile

Define the seccompProfile.profile for the container

Keyworkload.$name.podSpec.containers.$name.securityContext.seccompProfile.profile
Typestring
Required
Helm tpl
DefaultSee here

Example

workload:
workload-name:
podSpec:
containers:
container-name:
securityContext:
seccompProfile:
type: Localhost
profile: path/to/profile.json

Full Examples

workload:
workload-name:
enabled: true
primary: true
podSpec:
containers:
container-name:
enabled: true
primary: true
securityContext:
runAsNonRoot: true
runAsUser: 568
runAsGroup: 568
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
privileged: false
seccompProfile:
type: Localhost
profile: path/to/profile.json
capabilities:
add: []
drop:
- ALL