Package org.cdk8s.plus22
Class Container
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- org.cdk8s.plus22.Container
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-11T03:06:34.934Z") @Stability(Stable) public class Container extends software.amazon.jsii.JsiiObject
A single application container that you want to run within a pod.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContainer.BuilderA fluent builder forContainer.
-
Constructor Summary
Constructors Modifier Constructor Description Container(ContainerProps props)protectedContainer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedContainer(software.amazon.jsii.JsiiObjectRef objRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddPort(ContainerPort port)Add a port to expose from this container.List<String>getArgs()Arguments to the entrypoint.List<String>getCommand()Entrypoint array (the command to execute when the container starts).EnvgetEnv()The environment of the container.StringgetImage()The container image.ImagePullPolicygetImagePullPolicy()Image pull policy for this container.List<VolumeMount>getMounts()Volume mounts configured for this container.StringgetName()The name of the container.NumbergetPort()Deprecated.- use `portNumber`.NumbergetPortNumber()The port number that was configured for this container.List<ContainerPort>getPorts()Ports exposed by this containers.ContainerResourcesgetResources()Compute resources (CPU and memory requests and limits) required by the container.ContainerSecurityContextgetSecurityContext()The security context of the container.StringgetWorkingDir()The working directory inside the container.voidmount(String path, IStorage storage)Mount a volume to a specific path so that it is accessible by the container.voidmount(String path, IStorage storage, MountOptions options)Mount a volume to a specific path so that it is accessible by the container.-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
Container
protected Container(software.amazon.jsii.JsiiObjectRef objRef)
-
Container
protected Container(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
Container
@Stability(Stable) public Container(@NotNull ContainerProps props)- Parameters:
props- This parameter is required.
-
-
Method Detail
-
addPort
@Stability(Stable) public void addPort(@NotNull ContainerPort port)Add a port to expose from this container.- Parameters:
port- This parameter is required.
-
mount
@Stability(Stable) public void mount(@NotNull String path, @NotNull IStorage storage, @Nullable MountOptions options)Mount a volume to a specific path so that it is accessible by the container.Every pod that is configured to use this container will autmoatically have access to the volume.
- Parameters:
path- - The desired path in the container. This parameter is required.storage- - The storage to mount. This parameter is required.options-
-
mount
@Stability(Stable) public void mount(@NotNull String path, @NotNull IStorage storage)Mount a volume to a specific path so that it is accessible by the container.Every pod that is configured to use this container will autmoatically have access to the volume.
- Parameters:
path- - The desired path in the container. This parameter is required.storage- - The storage to mount. This parameter is required.
-
getEnv
@Stability(Stable) @NotNull public Env getEnv()
The environment of the container.
-
getImage
@Stability(Stable) @NotNull public String getImage()
The container image.
-
getImagePullPolicy
@Stability(Stable) @NotNull public ImagePullPolicy getImagePullPolicy()
Image pull policy for this container.
-
getMounts
@Stability(Stable) @NotNull public List<VolumeMount> getMounts()
Volume mounts configured for this container.
-
getName
@Stability(Stable) @NotNull public String getName()
The name of the container.
-
getPorts
@Stability(Stable) @NotNull public List<ContainerPort> getPorts()
Ports exposed by this containers.Returns a copy, use
addPortto modify.
-
getSecurityContext
@Stability(Stable) @NotNull public ContainerSecurityContext getSecurityContext()
The security context of the container.
-
getArgs
@Stability(Stable) @Nullable public List<String> getArgs()
Arguments to the entrypoint.- Returns:
- a copy of the arguments array, cannot be modified.
-
getCommand
@Stability(Stable) @Nullable public List<String> getCommand()
Entrypoint array (the command to execute when the container starts).- Returns:
- a copy of the entrypoint array, cannot be modified
-
getPort
@Stability(Deprecated) @Deprecated @Nullable public Number getPort()
Deprecated.- use `portNumber`.
-
getPortNumber
@Stability(Stable) @Nullable public Number getPortNumber()
The port number that was configured for this container.If undefined, either the container doesn't expose a port, or its port configuration is stored in the
portsfield.
-
getResources
@Stability(Stable) @Nullable public ContainerResources getResources()
Compute resources (CPU and memory requests and limits) required by the container.
-
getWorkingDir
@Stability(Stable) @Nullable public String getWorkingDir()
The working directory inside the container.
-
-