Package org.cdk8s.plus22
Class ContainerSecurityContextProps.Builder
- java.lang.Object
-
- org.cdk8s.plus22.ContainerSecurityContextProps.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ContainerSecurityContextProps>
- Enclosing interface:
- ContainerSecurityContextProps
@Stability(Stable) public static final class ContainerSecurityContextProps.Builder extends Object implements software.amazon.jsii.Builder<ContainerSecurityContextProps>
A builder forContainerSecurityContextProps
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerSecurityContextPropsbuild()Builds the configured instance.ContainerSecurityContextProps.BuilderensureNonRoot(Boolean ensureNonRoot)Sets the value ofContainerSecurityContextProps.getEnsureNonRoot()ContainerSecurityContextProps.Buildergroup(Number group)Sets the value ofContainerSecurityContextProps.getGroup()ContainerSecurityContextProps.Builderprivileged(Boolean privileged)Sets the value ofContainerSecurityContextProps.getPrivileged()ContainerSecurityContextProps.BuilderreadOnlyRootFilesystem(Boolean readOnlyRootFilesystem)Sets the value ofContainerSecurityContextProps.getReadOnlyRootFilesystem()ContainerSecurityContextProps.Builderuser(Number user)Sets the value ofContainerSecurityContextProps.getUser()
-
-
-
Method Detail
-
ensureNonRoot
@Stability(Stable) public ContainerSecurityContextProps.Builder ensureNonRoot(Boolean ensureNonRoot)
Sets the value ofContainerSecurityContextProps.getEnsureNonRoot()- Parameters:
ensureNonRoot- Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does.- Returns:
this
-
group
@Stability(Stable) public ContainerSecurityContextProps.Builder group(Number group)
Sets the value ofContainerSecurityContextProps.getGroup()- Parameters:
group- The GID to run the entrypoint of the container process.- Returns:
this
-
privileged
@Stability(Stable) public ContainerSecurityContextProps.Builder privileged(Boolean privileged)
Sets the value ofContainerSecurityContextProps.getPrivileged()- Parameters:
privileged- Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host.- Returns:
this
-
readOnlyRootFilesystem
@Stability(Stable) public ContainerSecurityContextProps.Builder readOnlyRootFilesystem(Boolean readOnlyRootFilesystem)
Sets the value ofContainerSecurityContextProps.getReadOnlyRootFilesystem()- Parameters:
readOnlyRootFilesystem- Whether this container has a read-only root filesystem.- Returns:
this
-
user
@Stability(Stable) public ContainerSecurityContextProps.Builder user(Number user)
Sets the value ofContainerSecurityContextProps.getUser()- Parameters:
user- The UID to run the entrypoint of the container process.- Returns:
this
-
build
@Stability(Stable) public ContainerSecurityContextProps build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ContainerSecurityContextProps>- Returns:
- a new instance of
ContainerSecurityContextProps - Throws:
NullPointerException- if any required attribute was not provided
-
-