Package org.cdk8s.plus24.k8s
Class PodSecurityPolicySpecV1Beta1.Builder
- java.lang.Object
-
- org.cdk8s.plus24.k8s.PodSecurityPolicySpecV1Beta1.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<PodSecurityPolicySpecV1Beta1>
- Enclosing interface:
- PodSecurityPolicySpecV1Beta1
@Stability(Stable) public static final class PodSecurityPolicySpecV1Beta1.Builder extends Object implements software.amazon.jsii.Builder<PodSecurityPolicySpecV1Beta1>
A builder forPodSecurityPolicySpecV1Beta1
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
fsGroup
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder fsGroup(FsGroupStrategyOptionsV1Beta1 fsGroup)
Sets the value ofPodSecurityPolicySpecV1Beta1.getFsGroup()
- Parameters:
fsGroup
- fsGroup is the strategy that will dictate what fs group is used by the SecurityContext. This parameter is required.- Returns:
this
-
runAsUser
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder runAsUser(RunAsUserStrategyOptionsV1Beta1 runAsUser)
Sets the value ofPodSecurityPolicySpecV1Beta1.getRunAsUser()
- Parameters:
runAsUser
- runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. This parameter is required.- Returns:
this
-
seLinux
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder seLinux(SeLinuxStrategyOptionsV1Beta1 seLinux)
Sets the value ofPodSecurityPolicySpecV1Beta1.getSeLinux()
- Parameters:
seLinux
- seLinux is the strategy that will dictate the allowable labels that may be set. This parameter is required.- Returns:
this
-
supplementalGroups
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder supplementalGroups(SupplementalGroupsStrategyOptionsV1Beta1 supplementalGroups)
Sets the value ofPodSecurityPolicySpecV1Beta1.getSupplementalGroups()
- Parameters:
supplementalGroups
- supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. This parameter is required.- Returns:
this
-
allowedCapabilities
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder allowedCapabilities(List<String> allowedCapabilities)
Sets the value ofPodSecurityPolicySpecV1Beta1.getAllowedCapabilities()
- Parameters:
allowedCapabilities
- allowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities.- Returns:
this
-
allowedCsiDrivers
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder allowedCsiDrivers(List<? extends AllowedCsiDriverV1Beta1> allowedCsiDrivers)
Sets the value ofPodSecurityPolicySpecV1Beta1.getAllowedCsiDrivers()
- Parameters:
allowedCsiDrivers
- AllowedCSIDrivers is an allowlist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. An empty value indicates that any CSI driver can be used for inline ephemeral volumes. This is a beta field, and is only honored if the API server enables the CSIInlineVolume feature gate.- Returns:
this
-
allowedFlexVolumes
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder allowedFlexVolumes(List<? extends AllowedFlexVolumeV1Beta1> allowedFlexVolumes)
Sets the value ofPodSecurityPolicySpecV1Beta1.getAllowedFlexVolumes()
- Parameters:
allowedFlexVolumes
- allowedFlexVolumes is an allowlist of Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the "volumes" field.- Returns:
this
-
allowedHostPaths
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder allowedHostPaths(List<? extends AllowedHostPathV1Beta1> allowedHostPaths)
Sets the value ofPodSecurityPolicySpecV1Beta1.getAllowedHostPaths()
- Parameters:
allowedHostPaths
- allowedHostPaths is an allowlist of host paths. Empty indicates that all host paths may be used.- Returns:
this
-
allowedProcMountTypes
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder allowedProcMountTypes(List<String> allowedProcMountTypes)
Sets the value ofPodSecurityPolicySpecV1Beta1.getAllowedProcMountTypes()
- Parameters:
allowedProcMountTypes
- AllowedProcMountTypes is an allowlist of allowed ProcMountTypes. Empty or nil indicates that only the DefaultProcMountType may be used. This requires the ProcMountType feature flag to be enabled.- Returns:
this
-
allowedUnsafeSysctls
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder allowedUnsafeSysctls(List<String> allowedUnsafeSysctls)
Sets the value ofPodSecurityPolicySpecV1Beta1.getAllowedUnsafeSysctls()
- Parameters:
allowedUnsafeSysctls
- allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. Kubelet has to allowlist all allowed unsafe sysctls explicitly to avoid rejection.Examples: e.g. "foo/" allows "foo/bar", "foo/baz", etc. e.g. "foo." allows "foo.bar", "foo.baz", etc.
- Returns:
this
-
allowPrivilegeEscalation
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder allowPrivilegeEscalation(Boolean allowPrivilegeEscalation)
Sets the value ofPodSecurityPolicySpecV1Beta1.getAllowPrivilegeEscalation()
- Parameters:
allowPrivilegeEscalation
- allowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true.- Returns:
this
-
defaultAddCapabilities
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder defaultAddCapabilities(List<String> defaultAddCapabilities)
Sets the value ofPodSecurityPolicySpecV1Beta1.getDefaultAddCapabilities()
- Parameters:
defaultAddCapabilities
- defaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the allowedCapabilities list.- Returns:
this
-
defaultAllowPrivilegeEscalation
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder defaultAllowPrivilegeEscalation(Boolean defaultAllowPrivilegeEscalation)
Sets the value ofPodSecurityPolicySpecV1Beta1.getDefaultAllowPrivilegeEscalation()
- Parameters:
defaultAllowPrivilegeEscalation
- defaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process.- Returns:
this
-
forbiddenSysctls
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder forbiddenSysctls(List<String> forbiddenSysctls)
Sets the value ofPodSecurityPolicySpecV1Beta1.getForbiddenSysctls()
- Parameters:
forbiddenSysctls
- forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of forbidden sysctls. Single * means all sysctls are forbidden.Examples: e.g. "foo/" forbids "foo/bar", "foo/baz", etc. e.g. "foo." forbids "foo.bar", "foo.baz", etc.
- Returns:
this
-
hostIpc
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder hostIpc(Boolean hostIpc)
Sets the value ofPodSecurityPolicySpecV1Beta1.getHostIpc()
- Parameters:
hostIpc
- hostIPC determines if the policy allows the use of HostIPC in the pod spec.- Returns:
this
-
hostNetwork
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder hostNetwork(Boolean hostNetwork)
Sets the value ofPodSecurityPolicySpecV1Beta1.getHostNetwork()
- Parameters:
hostNetwork
- hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.- Returns:
this
-
hostPid
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder hostPid(Boolean hostPid)
Sets the value ofPodSecurityPolicySpecV1Beta1.getHostPid()
- Parameters:
hostPid
- hostPID determines if the policy allows the use of HostPID in the pod spec.- Returns:
this
-
hostPorts
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder hostPorts(List<? extends HostPortRangeV1Beta1> hostPorts)
Sets the value ofPodSecurityPolicySpecV1Beta1.getHostPorts()
- Parameters:
hostPorts
- hostPorts determines which host port ranges are allowed to be exposed.- Returns:
this
-
privileged
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder privileged(Boolean privileged)
Sets the value ofPodSecurityPolicySpecV1Beta1.getPrivileged()
- Parameters:
privileged
- privileged determines if a pod can request to be run as privileged.- Returns:
this
-
readOnlyRootFilesystem
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder readOnlyRootFilesystem(Boolean readOnlyRootFilesystem)
Sets the value ofPodSecurityPolicySpecV1Beta1.getReadOnlyRootFilesystem()
- Parameters:
readOnlyRootFilesystem
- readOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to.- Returns:
this
-
requiredDropCapabilities
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder requiredDropCapabilities(List<String> requiredDropCapabilities)
Sets the value ofPodSecurityPolicySpecV1Beta1.getRequiredDropCapabilities()
- Parameters:
requiredDropCapabilities
- requiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added.- Returns:
this
-
runAsGroup
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder runAsGroup(RunAsGroupStrategyOptionsV1Beta1 runAsGroup)
Sets the value ofPodSecurityPolicySpecV1Beta1.getRunAsGroup()
- Parameters:
runAsGroup
- RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. If this field is omitted, the pod's RunAsGroup can take any value. This field requires the RunAsGroup feature gate to be enabled.- Returns:
this
-
runtimeClass
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder runtimeClass(RuntimeClassStrategyOptionsV1Beta1 runtimeClass)
Sets the value ofPodSecurityPolicySpecV1Beta1.getRuntimeClass()
- Parameters:
runtimeClass
- runtimeClass is the strategy that will dictate the allowable RuntimeClasses for a pod. If this field is omitted, the pod's runtimeClassName field is unrestricted. Enforcement of this field depends on the RuntimeClass feature gate being enabled.- Returns:
this
-
volumes
@Stability(Stable) public PodSecurityPolicySpecV1Beta1.Builder volumes(List<String> volumes)
Sets the value ofPodSecurityPolicySpecV1Beta1.getVolumes()
- Parameters:
volumes
- volumes is an allowlist of volume plugins. Empty indicates that no volumes may be used. To allow all volumes you may use '*'.- Returns:
this
-
build
@Stability(Stable) public PodSecurityPolicySpecV1Beta1 build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PodSecurityPolicySpecV1Beta1>
- Returns:
- a new instance of
PodSecurityPolicySpecV1Beta1
- Throws:
NullPointerException
- if any required attribute was not provided
-
-