ContainerV1 Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a container configuration for a Kubernetes pod.
[YamlDotNet.Serialization.YamlSerializable]
public sealed class ContainerV1
[<YamlDotNet.Serialization.YamlSerializable>]
type ContainerV1 = class
Public NotInheritable Class ContainerV1
- Inheritance
-
ContainerV1
- Attributes
-
YamlDotNet.Serialization.YamlSerializableAttribute
Remarks
This class defines the properties and behaviors of a container in a Kubernetes deployment. It supports detailed customization, including environmental variables, volume mounts, lifecycle management, probes, and security context settings.
Constructors
ContainerV1() |
Properties
Args |
Represents the arguments to pass to the container's entrypoint.
These arguments are added after the container's |
Command |
Gets the command to be executed by the container. Represents an optional list of strings that overrides the default entrypoint of the container's image. Each string in the list corresponds to a command line argument. |
Env |
Represents a list of environment variables defined for the container. These environment variables can be used within the container during runtime. |
EnvFrom |
Represents a list of environment variable sources for the container. Each item allows referencing a ConfigMap or Secret to populate environment variables within the container. Environment variables defined from these sources can include an optional prefix. |
Image |
Gets or sets the Docker image name for the container. Represents the image to be used in the container, including the repository name, image name, and optional tag. |
ImagePullPolicy |
Specifies the image pull policy for the container. Determines when the container's image should be pulled from the repository. Common values are "Always", "IfNotPresent", and "Never". The default value is "IfNotPresent", which means the image will only be pulled if it is not present locally. |
Lifecycle |
Gets or sets the lifecycle definition for the container, specifying actions to take in response to container lifecycle events, such as |
LivenessProbe |
Represents the liveness probe configuration for a container. This probe is used to determine if the container is still running and healthy. If the liveness probe fails, the container is restarted. The probe can be configured to use different mechanisms, including:
|
Name |
Gets or sets the name of the container. This property represents the unique name assigned to the container within the pod's definition in a Kubernetes deployment. |
Ports |
Represents a collection of ports exposed by the container and associated configurations. |
ReadinessProbe |
Defines the readiness probe configuration for a container. The readiness probe determines whether the container is ready to accept network traffic. A container passing its readiness probe is considered healthy and capable of serving network requests. This property accepts an instance of ProbeV1, enabling you to configure the specific checks, such as HTTP GET, command execution, or GRPC, to assess the readiness state. |
ResizePolicy |
Specifies the resize policies associated with a container in a Kubernetes environment. |
Resources |
Represents the resource requirements for a container, including memory and CPU limits and requests. The Resources property allows specifying the compute resources needed for container execution. |
RestartPolicy |
Defines the restart policy for the container. This property indicates how the container should behave when it terminates. Possible values include "Always", "OnFailure", and "Never", which dictate if the container should be restarted unconditionally, only on failure, or not restarted at all, respectively. |
SecurityContext |
Gets or sets the security context for a container. |
StartupProbe |
Gets or sets the startup probe configuration for the container. This probe is used to determine whether the application within the container has started successfully. The startup probe is executed to check the operational state of the application before the container is marked as ready, ensuring it can handle traffic before proceeding with normal operations. |
Stdin |
Gets or sets a value that determines whether the container's standard input (stdin) stream is kept open. This allows the container to receive input through the stdin stream after the application inside the container starts running. |
StdinOnce |
Gets or sets a value indicating whether the container's standard input (stdin) will be provided only once. When set to true, the container's stdin will remain open until the first read, after which it will be closed. Defaults to null, which indicates the property is not explicitly set. |
TerminationMessagePath |
Specifies the path where the termination message of the container will be written. This property allows the container to provide additional information about its termination, such as error messages or exit codes. If configured, the message written to this path will be retrievable by the container manager or monitoring systems. |
TerminationMessagePolicy |
Gets or sets the policy for capturing the termination message for the container. Defines how termination messages should be created and made available to the container. Possible values may include 'File' or 'FallbackToLogsOnError'. A 'File' policy captures the termination message from a specific file inside the container, while 'FallbackToLogsOnError' captures logs if the message file is inaccessible or unavailable. |
Tty |
Gets or sets a value indicating whether a TTY (teletypewriter) is allocated for the container. When set to true, a TTY is allocated, enabling interactive command execution. It is typically used for containers that require a terminal-like interaction. |
VolumeDevices |
Represents a collection of VolumeDeviceV1 objects that describe mappings of raw block devices within a container. |
VolumeMounts |
Represents a collection of volume mounts for the container. Each volume mount specifies how a volume will be mounted and accessed within the container. |
WorkingDir |
Gets or sets the working directory for the container. |