Package org.cdk8s.plus24
Class PodSecurityContextProps.Builder
- java.lang.Object
-
- org.cdk8s.plus24.PodSecurityContextProps.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<PodSecurityContextProps>
- Enclosing interface:
- PodSecurityContextProps
@Stability(Stable) public static final class PodSecurityContextProps.Builder extends Object implements software.amazon.jsii.Builder<PodSecurityContextProps>
A builder forPodSecurityContextProps
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PodSecurityContextProps
build()
Builds the configured instance.PodSecurityContextProps.Builder
ensureNonRoot(Boolean ensureNonRoot)
Sets the value ofPodSecurityContextProps.getEnsureNonRoot()
PodSecurityContextProps.Builder
fsGroup(Number fsGroup)
Sets the value ofPodSecurityContextProps.getFsGroup()
PodSecurityContextProps.Builder
fsGroupChangePolicy(FsGroupChangePolicy fsGroupChangePolicy)
Sets the value ofPodSecurityContextProps.getFsGroupChangePolicy()
PodSecurityContextProps.Builder
group(Number group)
Sets the value ofPodSecurityContextProps.getGroup()
PodSecurityContextProps.Builder
sysctls(List<? extends Sysctl> sysctls)
Sets the value ofPodSecurityContextProps.getSysctls()
PodSecurityContextProps.Builder
user(Number user)
Sets the value ofPodSecurityContextProps.getUser()
-
-
-
Method Detail
-
ensureNonRoot
@Stability(Stable) public PodSecurityContextProps.Builder ensureNonRoot(Boolean ensureNonRoot)
Sets the value ofPodSecurityContextProps.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
-
fsGroup
@Stability(Stable) public PodSecurityContextProps.Builder fsGroup(Number fsGroup)
Sets the value ofPodSecurityContextProps.getFsGroup()
- Parameters:
fsGroup
- Modify the ownership and permissions of pod volumes to this GID.- Returns:
this
-
fsGroupChangePolicy
@Stability(Stable) public PodSecurityContextProps.Builder fsGroupChangePolicy(FsGroupChangePolicy fsGroupChangePolicy)
Sets the value ofPodSecurityContextProps.getFsGroupChangePolicy()
- Parameters:
fsGroupChangePolicy
- Defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir.- Returns:
this
-
group
@Stability(Stable) public PodSecurityContextProps.Builder group(Number group)
Sets the value ofPodSecurityContextProps.getGroup()
- Parameters:
group
- The GID to run the entrypoint of the container process.- Returns:
this
-
sysctls
@Stability(Stable) public PodSecurityContextProps.Builder sysctls(List<? extends Sysctl> sysctls)
Sets the value ofPodSecurityContextProps.getSysctls()
- Parameters:
sysctls
- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch.- Returns:
this
-
user
@Stability(Stable) public PodSecurityContextProps.Builder user(Number user)
Sets the value ofPodSecurityContextProps.getUser()
- Parameters:
user
- The UID to run the entrypoint of the container process.- Returns:
this
-
build
@Stability(Stable) public PodSecurityContextProps build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PodSecurityContextProps>
- Returns:
- a new instance of
PodSecurityContextProps
- Throws:
NullPointerException
- if any required attribute was not provided
-
-