Package org.cdk8s.plus24
Class Container
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- org.cdk8s.plus24.Container
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.75.0 (build 63bb957)", date="2023-02-20T02:42:01.795Z") @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 class
Container.Builder
A fluent builder forContainer
.
-
Constructor Summary
Constructors Modifier Constructor Description Container(ContainerProps props)
protected
Container(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected
Container(software.amazon.jsii.JsiiObjectRef objRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addPort(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).Env
getEnv()
The environment of the container.String
getImage()
The container image.ImagePullPolicy
getImagePullPolicy()
Image pull policy for this container.List<VolumeMount>
getMounts()
Volume mounts configured for this container.String
getName()
The name of the container.Number
getPort()
Deprecated.- use `portNumber`.Number
getPortNumber()
The port number that was configured for this container.List<ContainerPort>
getPorts()
Ports exposed by this containers.ContainerResources
getResources()
Compute resources (CPU and memory requests and limits) required by the container.ContainerSecurityContext
getSecurityContext()
The security context of the container.String
getWorkingDir()
The working directory inside the container.void
mount(String path, IStorage storage)
Mount a volume to a specific path so that it is accessible by the container.void
mount(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
addPort
to 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
ports
field.
-
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.
-
-