Interface ContainerProps
-
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
ContainerProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.76.0 (build a2651be)", date="2023-03-02T02:39:27.363Z") @Stability(Stable) public interface ContainerProps extends software.amazon.jsii.JsiiSerializable
Properties for creating a container.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ContainerProps.Builder
A builder forContainerProps
static class
ContainerProps.Jsii$Proxy
An implementation forContainerProps
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description static ContainerProps.Builder
builder()
default List<String>
getArgs()
Arguments to the entrypoint.default List<String>
getCommand()
Entrypoint array.default List<EnvFrom>
getEnvFrom()
List of sources to populate environment variables in the container.default Map<String,EnvValue>
getEnvVariables()
Environment variables to set in the container.String
getImage()
Docker image name.default ImagePullPolicy
getImagePullPolicy()
Image pull policy for this container.default ContainerLifecycle
getLifecycle()
Describes actions that the management system should take in response to container lifecycle events.default Probe
getLiveness()
Periodic probe of container liveness.default String
getName()
Name of the container specified as a DNS_LABEL.default Number
getPort()
Deprecated.- use `portNumber`.default Number
getPortNumber()
Number of port to expose on the pod's IP address.default List<ContainerPort>
getPorts()
List of ports to expose from this container.default Probe
getReadiness()
Determines when the container is ready to serve traffic.default ContainerResources
getResources()
Compute resources (CPU and memory requests and limits) required by the container.default ContainerSecurityContextProps
getSecurityContext()
SecurityContext defines the security options the container should be run with.default Probe
getStartup()
StartupProbe indicates that the Pod has successfully initialized.default List<VolumeMount>
getVolumeMounts()
Pod volumes to mount into the container's filesystem.default String
getWorkingDir()
Container's working directory.
-
-
-
Method Detail
-
getImage
@Stability(Stable) @NotNull String getImage()
Docker image name.
-
getArgs
@Stability(Stable) @Nullable default List<String> getArgs()
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.
Default: []
-
getCommand
@Stability(Stable) @Nullable default List<String> getCommand()
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
Default: - The docker image's ENTRYPOINT.
-
getEnvFrom
@Stability(Stable) @Nullable default List<EnvFrom> getEnvFrom()
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 the
envVariables
property with a duplicate key will take precedence.Default: - No sources.
-
getEnvVariables
@Stability(Stable) @Nullable default Map<String,EnvValue> getEnvVariables()
Environment variables to set in the container.Default: - No environment variables.
-
getImagePullPolicy
@Stability(Stable) @Nullable default ImagePullPolicy getImagePullPolicy()
Image pull policy for this container.Default: ImagePullPolicy.ALWAYS
-
getLifecycle
@Stability(Stable) @Nullable default ContainerLifecycle getLifecycle()
Describes actions that the management system should take in response to container lifecycle events.
-
getLiveness
@Stability(Stable) @Nullable default Probe getLiveness()
Periodic probe of container liveness.Container will be restarted if the probe fails.
Default: - no liveness probe is defined
-
getName
@Stability(Stable) @Nullable default String getName()
Name of the container specified as a DNS_LABEL.Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.
Default: 'main'
-
getPort
@Stability(Deprecated) @Deprecated @Nullable default Number getPort()
Deprecated.- use `portNumber`.
-
getPortNumber
@Stability(Stable) @Nullable default Number getPortNumber()
Number of port to expose on the pod's IP address.This must be a valid port number, 0 < x < 65536.
This is a convinience property if all you need a single TCP numbered port. In case more advanced configuartion is required, use the
ports
property.This port is added to the list of ports mentioned in the
ports
property.Default: - Only the ports mentiond in the `ports` property are exposed.
-
getPorts
@Stability(Stable) @Nullable default List<ContainerPort> getPorts()
List of ports to expose from this container.Default: - Only the port mentioned in the `portNumber` property is exposed.
-
getReadiness
@Stability(Stable) @Nullable default Probe getReadiness()
Determines when the container is ready to serve traffic.Default: - no readiness probe is defined
-
getResources
@Stability(Stable) @Nullable default ContainerResources getResources()
Compute resources (CPU and memory requests and limits) required by the container.Default: cpu: request: 1000 millis limit: 1500 millis memory: request: 512 mebibytes limit: 2048 mebibytes
-
getSecurityContext
@Stability(Stable) @Nullable default ContainerSecurityContextProps getSecurityContext()
SecurityContext defines the security options the container should be run with.If set, the fields override equivalent fields of the pod's security context.
Default: ensureNonRoot: true privileged: false readOnlyRootFilesystem: true allowPrivilegeEscalation: false user: 25000 group: 26000
-
getStartup
@Stability(Stable) @Nullable default Probe getStartup()
StartupProbe indicates that the Pod has successfully initialized.If specified, no other probes are executed until this completes successfully
Default: - If a port is provided, then knocks on that port to determine when the container is ready for readiness and liveness probe checks. Otherwise, no startup probe is defined.
-
getVolumeMounts
@Stability(Stable) @Nullable default List<VolumeMount> getVolumeMounts()
Pod volumes to mount into the container's filesystem.Cannot be updated.
-
getWorkingDir
@Stability(Stable) @Nullable default String getWorkingDir()
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.
Default: - The container runtime's default.
-
builder
@Stability(Stable) static ContainerProps.Builder builder()
- Returns:
- a
ContainerProps.Builder
ofContainerProps
-
-