Class V1Container
A single application container that you want to run within a pod.
Assembly: KubernetesClient.dll
Syntax
public record V1Container : IEquatable<V1Container>
Constructors
View Source
V1Container()
Declaration
View Source
V1Container(V1Container)
Declaration
protected V1Container(V1Container original)
Parameters
Properties
View Source
Args
Arguments to the entrypoint. The container image's CMD 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. Double $$ are reduced to a single $, which allows for
escaping the \((VAR_NAME) syntax: i.e. "$\)(VAR_NAME)" will produce the string
literal "$(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
Declaration
[JsonPropertyName("args")]
public IList<string> Args { get; set; }
Property Value
View Source
Command
Entrypoint array. Not executed within a shell. The container 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. Double $$ are reduced to a
single $, which allows for escaping the \((VAR_NAME) syntax: i.e. "$\)(VAR_NAME)"
will produce the string literal "$(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
Declaration
[JsonPropertyName("command")]
public IList<string> Command { get; set; }
Property Value
View Source
Env
List of environment variables to set in the container. Cannot be updated.
Declaration
[JsonPropertyName("env")]
public IList<V1EnvVar> Env { get; set; }
Property Value
View Source
EnvFrom
List of sources to populate environment variables in the container. The keys
defined within a source may consist of any printable ASCII characters except
'='. When a key exists in multiple sources, the value associated with the last
source will take precedence. Values defined by an Env with a duplicate key will
take precedence. Cannot be updated.
Declaration
[JsonPropertyName("envFrom")]
public IList<V1EnvFromSource> EnvFrom { get; set; }
Property Value
View Source
EqualityContract
Declaration
protected virtual Type EqualityContract { get; }
Property Value
View Source
Image
Declaration
[JsonPropertyName("image")]
public string Image { get; set; }
Property Value
View Source
ImagePullPolicy
Declaration
[JsonPropertyName("imagePullPolicy")]
public string ImagePullPolicy { get; set; }
Property Value
View Source
Lifecycle
Actions that the management system should take in response to container
lifecycle events. Cannot be updated.
Declaration
[JsonPropertyName("lifecycle")]
public V1Lifecycle Lifecycle { get; set; }
Property Value
View Source
LivenessProbe
Declaration
[JsonPropertyName("livenessProbe")]
public V1Probe LivenessProbe { get; set; }
Property Value
View Source
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.
Declaration
[JsonPropertyName("name")]
public string Name { get; set; }
Property Value
View Source
Ports
List of ports to expose from the container. Not specifying a port here DOES NOT
prevent that port from being exposed. Any port which is listening on the default
"0.0.0.0" address inside a container will be accessible from the network.
Modifying this array with strategic merge patch may corrupt the data. For more
information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot
be updated.
Declaration
[JsonPropertyName("ports")]
public IList<V1ContainerPort> Ports { get; set; }
Property Value
View Source
ReadinessProbe
Declaration
[JsonPropertyName("readinessProbe")]
public V1Probe ReadinessProbe { get; set; }
Property Value
View Source
ResizePolicy
Resources resize policy for the container.
Declaration
[JsonPropertyName("resizePolicy")]
public IList<V1ContainerResizePolicy> ResizePolicy { get; set; }
Property Value
View Source
Resources
Declaration
[JsonPropertyName("resources")]
public V1ResourceRequirements Resources { get; set; }
Property Value
View Source
RestartPolicy
RestartPolicy defines the restart behavior of individual containers in a pod.
This overrides the pod-level restart policy. When this field is not specified,
the restart behavior is defined by the Pod's restart policy and the container
type. Additionally, setting the RestartPolicy as "Always" for the init container
will have the following effect: this init container will be continually
restarted on exit until all regular containers have terminated. Once all regular
containers have completed, all init containers with restartPolicy "Always" will
be shut down. This lifecycle differs from normal init containers and is often
referred to as a "sidecar" container. Although this init container still starts
in the init container sequence, it does not wait for the container to complete
before proceeding to the next init container. Instead, the next init container
starts immediately after this init container is started, or after any
startupProbe has successfully completed.
Declaration
[JsonPropertyName("restartPolicy")]
public string RestartPolicy { get; set; }
Property Value
View Source
RestartPolicyRules
Represents a list of rules to be checked to determine if the container should be
restarted on exit. The rules are evaluated in order. Once a rule matches a
container exit condition, the remaining rules are ignored. If no rule matches
the container exit condition, the Container-level restart policy determines the
whether the container is restarted or not. Constraints on the rules: - At most
20 rules are allowed. - Rules can have the same action. - Identical rules are
not forbidden in validations. When rules are specified, container MUST set
RestartPolicy explicitly even it if matches the Pod's RestartPolicy.
Declaration
[JsonPropertyName("restartPolicyRules")]
public IList<V1ContainerRestartRule> RestartPolicyRules { get; set; }
Property Value
View Source
SecurityContext
Declaration
[JsonPropertyName("securityContext")]
public V1SecurityContext SecurityContext { get; set; }
Property Value
View Source
StartupProbe
StartupProbe indicates that the Pod has successfully initialized. If specified,
no other probes are executed until this completes successfully. If this probe
fails, the Pod will be restarted, just as if the livenessProbe failed. This can
be used to provide different probe parameters at the beginning of a Pod's
lifecycle, when it might take a long time to load data or warm a cache, than
during steady-state operation. This cannot be updated. More info:
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Declaration
[JsonPropertyName("startupProbe")]
public V1Probe StartupProbe { get; set; }
Property Value
View Source
Stdin
Whether this container should allocate a buffer for stdin in the container
runtime. If this is not set, reads from stdin in the container will always
result in EOF. Default is false.
Declaration
[JsonPropertyName("stdin")]
public bool? Stdin { get; set; }
Property Value
View Source
StdinOnce
Whether the container runtime should close the stdin channel after it has been
opened by a single attach. When stdin is true the stdin stream will remain open
across multiple attach sessions. If stdinOnce is set to true, stdin is opened on
container start, is empty until the first client attaches to stdin, and then
remains open and accepts data until the client disconnects, at which time stdin
is closed and remains closed until the container is restarted. If this flag is
false, a container processes that reads from stdin will never receive an EOF.
Default is false
Declaration
[JsonPropertyName("stdinOnce")]
public bool? StdinOnce { get; set; }
Property Value
View Source
TerminationMessagePath
Optional: Path at which the file to which the container's termination message
will be written is mounted into the container's filesystem. Message written is
intended to be brief final status, such as an assertion failure message. Will be
truncated by the node if greater than 4096 bytes. The total message length
across all containers will be limited to 12kb. Defaults to /dev/termination-log.
Cannot be updated.
Declaration
[JsonPropertyName("terminationMessagePath")]
public string TerminationMessagePath { get; set; }
Property Value
View Source
TerminationMessagePolicy
Indicate how the termination message should be populated. File will use the
contents of terminationMessagePath to populate the container status message on
both success and failure. FallbackToLogsOnError will use the last chunk of
container log output if the termination message file is empty and the container
exited with an error. The log output is limited to 2048 bytes or 80 lines,
whichever is smaller. Defaults to File. Cannot be updated.
Declaration
[JsonPropertyName("terminationMessagePolicy")]
public string TerminationMessagePolicy { get; set; }
Property Value
View Source
Tty
Whether this container should allocate a TTY for itself, also requires 'stdin'
to be true. Default is false.
Declaration
[JsonPropertyName("tty")]
public bool? Tty { get; set; }
Property Value
View Source
VolumeDevices
volumeDevices is the list of block devices to be used by the container.
Declaration
[JsonPropertyName("volumeDevices")]
public IList<V1VolumeDevice> VolumeDevices { get; set; }
Property Value
View Source
VolumeMounts
Pod volumes to mount into the container's filesystem. Cannot be updated.
Declaration
[JsonPropertyName("volumeMounts")]
public IList<V1VolumeMount> VolumeMounts { get; set; }
Property Value
View Source
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.
Declaration
[JsonPropertyName("workingDir")]
public string WorkingDir { get; set; }
Property Value
Methods
View Source
Equals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
View Source
Equals(V1Container?)
Declaration
public virtual bool Equals(V1Container? other)
Parameters
Returns
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
View Source
PrintMembers(StringBuilder)
Declaration
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
Returns
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
View Source
operator ==(V1Container?, V1Container?)
Declaration
public static bool operator ==(V1Container? left, V1Container? right)
Parameters
Returns
View Source
operator !=(V1Container?, V1Container?)
Declaration
public static bool operator !=(V1Container? left, V1Container? right)
Parameters
Returns
Implements