Package org.cdk8s.plus24
Class ContainerProps.Builder
- java.lang.Object
-
- org.cdk8s.plus24.ContainerProps.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ContainerProps>
- Enclosing interface:
- ContainerProps
@Stability(Stable) public static final class ContainerProps.Builder extends Object implements software.amazon.jsii.Builder<ContainerProps>
A builder forContainerProps
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
image
@Stability(Stable) public ContainerProps.Builder image(String image)
Sets the value ofContainerProps.getImage()
- Parameters:
image
- Docker image name. This parameter is required.- Returns:
this
-
args
@Stability(Stable) public ContainerProps.Builder args(List<String> args)
Sets the value ofContainerProps.getArgs()
- Parameters:
args
- Arguments to the entrypoint. The docker image's CMD is used if `command` is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not.Cannot be updated.
- Returns:
this
-
command
@Stability(Stable) public ContainerProps.Builder command(List<String> command)
Sets the value ofContainerProps.getCommand()
- Parameters:
command
- Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell- Returns:
this
-
envFrom
@Stability(Stable) public ContainerProps.Builder envFrom(List<? extends EnvFrom> envFrom)
Sets the value ofContainerProps.getEnvFrom()
- Parameters:
envFrom
- List of sources to populate environment variables in the container. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by theenvVariables
property with a duplicate key will take precedence.- Returns:
this
-
envVariables
@Stability(Stable) public ContainerProps.Builder envVariables(Map<String,? extends EnvValue> envVariables)
Sets the value ofContainerProps.getEnvVariables()
- Parameters:
envVariables
- Environment variables to set in the container.- Returns:
this
-
imagePullPolicy
@Stability(Stable) public ContainerProps.Builder imagePullPolicy(ImagePullPolicy imagePullPolicy)
Sets the value ofContainerProps.getImagePullPolicy()
- Parameters:
imagePullPolicy
- Image pull policy for this container.- Returns:
this
-
lifecycle
@Stability(Stable) public ContainerProps.Builder lifecycle(ContainerLifecycle lifecycle)
Sets the value ofContainerProps.getLifecycle()
- Parameters:
lifecycle
- Describes actions that the management system should take in response to container lifecycle events.- Returns:
this
-
liveness
@Stability(Stable) public ContainerProps.Builder liveness(Probe liveness)
Sets the value ofContainerProps.getLiveness()
- Parameters:
liveness
- Periodic probe of container liveness. Container will be restarted if the probe fails.- Returns:
this
-
name
@Stability(Stable) public ContainerProps.Builder name(String name)
Sets the value ofContainerProps.getName()
- Parameters:
name
- Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.- Returns:
this
-
port
@Stability(Stable) public ContainerProps.Builder port(Number port)
Sets the value ofContainerProps.getPort()
- Parameters:
port
- Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.- Returns:
this
-
readiness
@Stability(Stable) public ContainerProps.Builder readiness(Probe readiness)
Sets the value ofContainerProps.getReadiness()
- Parameters:
readiness
- Determines when the container is ready to serve traffic.- Returns:
this
-
resources
@Stability(Stable) public ContainerProps.Builder resources(ContainerResources resources)
Sets the value ofContainerProps.getResources()
- Parameters:
resources
- Compute resources (CPU and memory requests and limits) required by the container.- Returns:
this
-
securityContext
@Stability(Stable) public ContainerProps.Builder securityContext(ContainerSecurityContextProps securityContext)
Sets the value ofContainerProps.getSecurityContext()
- Parameters:
securityContext
- SecurityContext defines the security options the container should be run with. If set, the fields override equivalent fields of the pod's security context.- Returns:
this
-
startup
@Stability(Stable) public ContainerProps.Builder startup(Probe startup)
Sets the value ofContainerProps.getStartup()
- Parameters:
startup
- StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully- Returns:
this
-
volumeMounts
@Stability(Stable) public ContainerProps.Builder volumeMounts(List<? extends VolumeMount> volumeMounts)
Sets the value ofContainerProps.getVolumeMounts()
- Parameters:
volumeMounts
- Pod volumes to mount into the container's filesystem. Cannot be updated.- Returns:
this
-
workingDir
@Stability(Stable) public ContainerProps.Builder workingDir(String workingDir)
Sets the value ofContainerProps.getWorkingDir()
- Parameters:
workingDir
- Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.- Returns:
this
-
build
@Stability(Stable) public ContainerProps build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ContainerProps>
- Returns:
- a new instance of
ContainerProps
- Throws:
NullPointerException
- if any required attribute was not provided
-
-