pub struct ContainerPort {
pub name: Option<String>,
pub host_port: Option<i32>,
pub container_port: Option<i32>,
pub protocol: Option<String>,
pub host_ip: Option<String>,
}
Expand description
ContainerPort represents a network port in a single container.
Fields§
§name: Option<String>
If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. +optional
host_port: Option<i32>
Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. +optional
container_port: Option<i32>
Number of port to expose on the pod’s IP address. This must be a valid port number, 0 < x < 65536.
protocol: Option<String>
Protocol for port. Must be UDP, TCP, or SCTP. Defaults to “TCP”. +optional +default=“TCP”
host_ip: Option<String>
What host IP to bind the external port to. +optional
Implementations§
Source§impl ContainerPort
impl ContainerPort
Sourcepub fn host_port(&self) -> i32
pub fn host_port(&self) -> i32
Returns the value of host_port
, or the default value if host_port
is unset.
Sourcepub fn container_port(&self) -> i32
pub fn container_port(&self) -> i32
Returns the value of container_port
, or the default value if container_port
is unset.
Trait Implementations§
Source§impl Clone for ContainerPort
impl Clone for ContainerPort
Source§fn clone(&self) -> ContainerPort
fn clone(&self) -> ContainerPort
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ContainerPort
impl Debug for ContainerPort
Source§impl Default for ContainerPort
impl Default for ContainerPort
Source§impl Hash for ContainerPort
impl Hash for ContainerPort
Source§impl Message for ContainerPort
impl Message for ContainerPort
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
.