Package org.cdk8s.plus24
Class ContainerSecurityContextProps.Builder
- java.lang.Object
-
- org.cdk8s.plus24.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
-
-
-
Method Detail
-
allowPrivilegeEscalation
@Stability(Stable) public ContainerSecurityContextProps.Builder allowPrivilegeEscalation(Boolean allowPrivilegeEscalation)
Sets the value ofContainerSecurityContextProps.getAllowPrivilegeEscalation()
- Parameters:
allowPrivilegeEscalation
- Whether a process can gain more privileges than its parent process.- Returns:
this
-
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:
build
in interfacesoftware.amazon.jsii.Builder<ContainerSecurityContextProps>
- Returns:
- a new instance of
ContainerSecurityContextProps
- Throws:
NullPointerException
- if any required attribute was not provided
-
-