pub struct ContainerConfig {Show 16 fields
pub metadata: Option<ContainerMetadata>,
pub image: Option<ImageSpec>,
pub command: Vec<String>,
pub args: Vec<String>,
pub working_dir: String,
pub envs: Vec<KeyValue>,
pub mounts: Vec<Mount>,
pub devices: Vec<Device>,
pub labels: HashMap<String, String>,
pub annotations: HashMap<String, String>,
pub log_path: String,
pub stdin: bool,
pub stdin_once: bool,
pub tty: bool,
pub linux: Option<LinuxContainerConfig>,
pub windows: Option<WindowsContainerConfig>,
}Expand description
ContainerConfig holds all the required and optional fields for creating a container.
Fields§
§metadata: Option<ContainerMetadata>Metadata of the container. This information will uniquely identify the container, and the runtime should leverage this to ensure correct operation. The runtime may also use this information to improve UX, such as by constructing a readable name.
image: Option<ImageSpec>Image to use.
command: Vec<String>Command to execute (i.e., entrypoint for docker)
args: Vec<String>Args for the Command (i.e., command for docker)
working_dir: StringCurrent working directory of the command.
envs: Vec<KeyValue>List of environment variable to set in the container.
mounts: Vec<Mount>Mounts for the container.
devices: Vec<Device>Devices for the container.
labels: HashMap<String, String>Key-value pairs that may be used to scope and select individual resources. Label keys are of the form: label-key ::= prefixed-name | name prefixed-name ::= prefix ‘/’ name prefix ::= DNS_SUBDOMAIN name ::= DNS_LABEL
annotations: HashMap<String, String>Unstructured key-value map that may be used by the kubelet to store and retrieve arbitrary metadata.
Annotations MUST NOT be altered by the runtime; the annotations stored here MUST be returned in the ContainerStatus associated with the container this ContainerConfig creates.
In general, in order to preserve a well-defined interface between the kubelet and the container runtime, annotations SHOULD NOT influence runtime behaviour.
log_path: StringPath relative to PodSandboxConfig.LogDirectory for container to store
the log (STDOUT and STDERR) on the host.
E.g.,
PodSandboxConfig.LogDirectory = /var/log/pods/<podUID>/
ContainerConfig.LogPath = containerName/Instance#.log
WARNING: Log management and how kubelet should interface with the container logs are under active discussion in https://issues.k8s.io/24677. There may be future change of direction for logging as the discussion carries on.
stdin: boolVariables for interactive containers, these have very specialized use-cases (e.g. debugging).
stdin_once: bool§tty: bool§linux: Option<LinuxContainerConfig>Configuration specific to Linux containers.
windows: Option<WindowsContainerConfig>Configuration specific to Windows containers.
Trait Implementations§
Source§impl Clone for ContainerConfig
impl Clone for ContainerConfig
Source§fn clone(&self) -> ContainerConfig
fn clone(&self) -> ContainerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContainerConfig
impl Debug for ContainerConfig
Source§impl Default for ContainerConfig
impl Default for ContainerConfig
Source§impl<'de> Deserialize<'de> for ContainerConfig
impl<'de> Deserialize<'de> for ContainerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for ContainerConfig
impl Message for ContainerConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for ContainerConfig
impl PartialEq for ContainerConfig
Source§impl Serialize for ContainerConfig
impl Serialize for ContainerConfig
impl StructuralPartialEq for ContainerConfig
Auto Trait Implementations§
impl Freeze for ContainerConfig
impl RefUnwindSafe for ContainerConfig
impl Send for ContainerConfig
impl Sync for ContainerConfig
impl Unpin for ContainerConfig
impl UnwindSafe for ContainerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request