Class EksContainerDefinitionProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EksContainerDefinitionProps>
- Enclosing interface:
EksContainerDefinitionProps
EksContainerDefinitionProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofEksContainerDefinitionProps.getArgs()
build()
Builds the configured instance.Sets the value ofEksContainerDefinitionProps.getCommand()
Sets the value ofEksContainerDefinitionProps.getCpuLimit()
cpuReservation
(Number cpuReservation) Sets the value ofEksContainerDefinitionProps.getCpuReservation()
Sets the value ofEksContainerDefinitionProps.getEnv()
Sets the value ofEksContainerDefinitionProps.getGpuLimit()
gpuReservation
(Number gpuReservation) Sets the value ofEksContainerDefinitionProps.getGpuReservation()
image
(ContainerImage image) Sets the value ofEksContainerDefinitionProps.getImage()
imagePullPolicy
(ImagePullPolicy imagePullPolicy) Sets the value ofEksContainerDefinitionProps.getImagePullPolicy()
memoryLimit
(Size memoryLimit) Sets the value ofEksContainerDefinitionProps.getMemoryLimit()
memoryReservation
(Size memoryReservation) Sets the value ofEksContainerDefinitionProps.getMemoryReservation()
Sets the value ofEksContainerDefinitionProps.getName()
privileged
(Boolean privileged) Sets the value ofEksContainerDefinitionProps.getPrivileged()
readonlyRootFilesystem
(Boolean readonlyRootFilesystem) Sets the value ofEksContainerDefinitionProps.getReadonlyRootFilesystem()
runAsGroup
(Number runAsGroup) Sets the value ofEksContainerDefinitionProps.getRunAsGroup()
Sets the value ofEksContainerDefinitionProps.getRunAsRoot()
Sets the value ofEksContainerDefinitionProps.getRunAsUser()
Sets the value ofEksContainerDefinitionProps.getVolumes()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
image
Sets the value ofEksContainerDefinitionProps.getImage()
- Parameters:
image
- The image that this container will run. This parameter is required.- Returns:
this
-
args
Sets the value ofEksContainerDefinitionProps.getArgs()
- Parameters:
args
- An array of arguments to the entrypoint. If this isn't specified, the CMD of the container image is used. This corresponds to the args member in the Entrypoint portion of the Pod in Kubernetes. Environment variable references are expanded using the container's environment. If the referenced environment variable doesn't exist, the reference in the command isn't changed. For example, if the reference is to "$(NAME1)" and the NAME1 environment variable doesn't exist, the command string will remain "$(NAME1)." $$ is replaced with $, and the resulting string isn't expanded. or example, $$(VAR_NAME) is passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists.- Returns:
this
-
command
Sets the value ofEksContainerDefinitionProps.getCommand()
- Parameters:
command
- The entrypoint for the container. This isn't run within a shell. If this isn't specified, theENTRYPOINT
of the container image is used. Environment variable references are expanded using the container's environment. If the referenced environment variable doesn't exist, the reference in the command isn't changed. For example, if the reference is to"$(NAME1)"
and theNAME1
environment variable doesn't exist, the command string will remain"$(NAME1)."
$$
is replaced with$
and the resulting string isn't expanded. For example,$$(VAR_NAME)
will be passed as$(VAR_NAME)
whether or not theVAR_NAME
environment variable exists.The entrypoint can't be updated.
- Returns:
this
-
cpuLimit
Sets the value ofEksContainerDefinitionProps.getCpuLimit()
- Parameters:
cpuLimit
- The hard limit of CPUs to present to this container. Must be an even multiple of 0.25. If your container attempts to exceed this limit, it will be terminated.At least one of
cpuReservation
andcpuLimit
is required. If both are specified, thencpuLimit
must be at least as large ascpuReservation
.- Returns:
this
-
cpuReservation
Sets the value ofEksContainerDefinitionProps.getCpuReservation()
- Parameters:
cpuReservation
- The soft limit of CPUs to reserve for the container Must be an even multiple of 0.25. The container will given at least this many CPUs, but may consume more.At least one of
cpuReservation
andcpuLimit
is required. If both are specified, thencpuLimit
must be at least as large ascpuReservation
.- Returns:
this
-
env
Sets the value ofEksContainerDefinitionProps.getEnv()
- Parameters:
env
- The environment variables to pass to this container. Note: Environment variables cannot start with "AWS_BATCH". This naming convention is reserved for variables that AWS Batch sets.- Returns:
this
-
gpuLimit
Sets the value ofEksContainerDefinitionProps.getGpuLimit()
- Parameters:
gpuLimit
- The hard limit of GPUs to present to this container. If your container attempts to exceed this limit, it will be terminated.If both
gpuReservation
andgpuLimit
are specified, thengpuLimit
must be equal togpuReservation
.- Returns:
this
-
gpuReservation
Sets the value ofEksContainerDefinitionProps.getGpuReservation()
- Parameters:
gpuReservation
- The soft limit of CPUs to reserve for the container Must be an even multiple of 0.25. The container will given at least this many CPUs, but may consume more.If both
gpuReservation
andgpuLimit
are specified, thengpuLimit
must be equal togpuReservation
.- Returns:
this
-
imagePullPolicy
@Stability(Stable) public EksContainerDefinitionProps.Builder imagePullPolicy(ImagePullPolicy imagePullPolicy) Sets the value ofEksContainerDefinitionProps.getImagePullPolicy()
- Parameters:
imagePullPolicy
- The image pull policy for this container.- Returns:
this
-
memoryLimit
Sets the value ofEksContainerDefinitionProps.getMemoryLimit()
- Parameters:
memoryLimit
- The amount (in MiB) of memory to present to the container. If your container attempts to exceed the allocated memory, it will be terminated.Must be larger that 4 MiB
At least one of
memoryLimit
andmemoryReservation
is requiredNote: To maximize your resource utilization, provide your jobs with as much memory as possible for the specific instance type that you are using.
- Returns:
this
-
memoryReservation
@Stability(Stable) public EksContainerDefinitionProps.Builder memoryReservation(Size memoryReservation) Sets the value ofEksContainerDefinitionProps.getMemoryReservation()
- Parameters:
memoryReservation
- The soft limit (in MiB) of memory to reserve for the container. Your container will be given at least this much memory, but may consume more.Must be larger that 4 MiB
When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the memory parameter (if applicable), or all of the available memory on the container instance, whichever comes first.
At least one of
memoryLimit
andmemoryReservation
is required. If both are specified, thenmemoryLimit
must be equal tomemoryReservation
Note: To maximize your resource utilization, provide your jobs with as much memory as possible for the specific instance type that you are using.
- Returns:
this
-
name
Sets the value ofEksContainerDefinitionProps.getName()
- Parameters:
name
- The name of this container.- Returns:
this
-
privileged
Sets the value ofEksContainerDefinitionProps.getPrivileged()
- Parameters:
privileged
- If specified, gives this container elevated permissions on the host container instance. The level of permissions are similar to the root user permissions.This parameter maps to
privileged
policy in the Privileged pod security policies in the Kubernetes documentation.Note: this is only compatible with Kubernetes < v1.25
- Returns:
this
-
readonlyRootFilesystem
@Stability(Stable) public EksContainerDefinitionProps.Builder readonlyRootFilesystem(Boolean readonlyRootFilesystem) Sets the value ofEksContainerDefinitionProps.getReadonlyRootFilesystem()
- Parameters:
readonlyRootFilesystem
- If specified, gives this container readonly access to its root file system. This parameter maps toReadOnlyRootFilesystem
policy in the Volumes and file systems pod security policies in the Kubernetes documentation.Note: this is only compatible with Kubernetes < v1.25
- Returns:
this
-
runAsGroup
Sets the value ofEksContainerDefinitionProps.getRunAsGroup()
- Parameters:
runAsGroup
- If specified, the container is run as the specified group ID (gid
). If this parameter isn't specified, the default is the group that's specified in the image metadata. This parameter maps toRunAsGroup
andMustRunAs
policy in the Users and groups pod security policies in the Kubernetes documentation.Note: this is only compatible with Kubernetes < v1.25
- Returns:
this
-
runAsRoot
Sets the value ofEksContainerDefinitionProps.getRunAsRoot()
- Parameters:
runAsRoot
- If specified, the container is run as a user with auid
other than 0. Otherwise, no such rule is enforced. This parameter maps toRunAsUser
andMustRunAsNonRoot
policy in the Users and groups pod security policies in the Kubernetes documentation.Note: this is only compatible with Kubernetes < v1.25
- Returns:
this
-
runAsUser
Sets the value ofEksContainerDefinitionProps.getRunAsUser()
- Parameters:
runAsUser
- If specified, this container is run as the specified user ID (uid
). This parameter maps toRunAsUser
andMustRunAs
policy in the Users and groups pod security policies in the Kubernetes documentation.Note: this is only compatible with Kubernetes < v1.25
- Returns:
this
-
volumes
@Stability(Stable) public EksContainerDefinitionProps.Builder volumes(List<? extends EksVolume> volumes) Sets the value ofEksContainerDefinitionProps.getVolumes()
- Parameters:
volumes
- The Volumes to mount to this container. Automatically added to the Pod.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<EksContainerDefinitionProps>
- Returns:
- a new instance of
EksContainerDefinitionProps
- Throws:
NullPointerException
- if any required attribute was not provided
-