Struct PodCreateOptsBuilder

Source
pub struct PodCreateOptsBuilder { /* private fields */ }
Expand description

A builder struct for PodCreateOpts.

Implementations§

Source§

impl PodCreateOptsBuilder

Source

pub fn build(self) -> PodCreateOpts

Finish building PodCreateOpts.

Source§

impl PodCreateOptsBuilder

Source

pub fn cgroup_parent(self, cgroup_parent: impl Serialize) -> Self

The parent for the CGroup that the pod will create. This pod cgroup will, in turn, be the default cgroup parent for all containers in the pod.

Source

pub fn cni_networks<S>(self, cni_networks: impl IntoIterator<Item = S>) -> Self
where S: Serialize,

List of CNI networks to join the container to. If this list is empty, the default CNI network will be joined instead. If at least one entry is present, we will not join the default network (unless it is part of this list). Only available if NetNS is set to bridge. Optional. Deprecated: as of podman 4.0 use “Networks” instead.

Source

pub fn cpu_period(self, cpu_period: u64) -> Self

CPU period of the cpuset, determined by –cpus

Source

pub fn cpu_quota(self, cpu_quota: i64) -> Self

CPU quota of the cpuset, determined by –cpus

Source

pub fn dns_option<S>(self, dns_option: impl IntoIterator<Item = S>) -> Self
where S: Serialize,

Set of DNS options that will be used in the infra container’s resolv.conf, which will, by default, be shared with all containers in the pod. Conflicts with no_infra == true.

Set of DNS search domains that will be used in the infra container’s resolv.conf, which will, by default, be shared with all containers in the pod. If not provided, DNS search domains from the host’s resolv.conf will be used. Conflicts with no_infra == true.

Source

pub fn dns_server<S>(self, dns_server: impl IntoIterator<Item = S>) -> Self
where S: Serialize,

Set of DNS servers that will be used in the infra container’s resolv.conf, which will, by default, be shared with all containers in the pod. If not provided, the host’s DNS servers will be used, unless the only server set is a localhost address. As the container cannot connect to the host’s localhost, a default server will instead be set. Conflicts with no_infra == true.

Source

pub fn exit_policy(self, exit_policy: impl Serialize) -> Self

Determines the pod’s exit and stop behaviour.

Source

pub fn add_hosts<S>(self, add_hosts: impl IntoIterator<Item = S>) -> Self
where S: Serialize,

Set of hosts that will be added to the infra container’s etc/hosts that will, by default, be shared with all containers in the pod. Conflicts with no_infra == true and no_manage_hosts.

Source

pub fn hostname(self, hostname: impl Serialize) -> Self

The pod’s hostname. If not set, the name of the pod will be used (if a name was not provided here, the name auto-generated for the pod will be used). This will be used by the infra container and all containers in the pod as long as the UTS namespace is shared.

Source

pub fn idmappings(self, idmappings: IdMappingOptions) -> Self

Used for specifying how ID mapping should be set up for a layer or container.

Source

pub fn image_volumes( self, image_volumes: impl IntoIterator<Item = ImageVolume>, ) -> Self

Image volumes bind-mount a container-image mount into the pod’s infra container.

Source

pub fn infra_command<S>( self, infra_command: impl IntoIterator<Item = S>, ) -> Self
where S: Serialize,

Sets the command that will be used to start the infra container. If not set, the default set in the Libpod configuration file will be used. Conflicts with no_infra == true.

Source

pub fn infra_common_pid_file( self, infra_common_pid_file: impl Serialize, ) -> Self

Custom path to store the infra container’s conmon PID.

Source

pub fn infra_image(self, infra_image: impl Serialize) -> Self

The image that will be used for the infra container. If not set, the default set in the Libpod configuration file will be used. Conflicts with no_infra == true.

Source

pub fn infra_name(self, infra_name: impl Serialize) -> Self

The name that will be used for the infra container. If not set, the default set in the Libpod configuration file will be used. Conflicts with no_infra == true.

Source

pub fn labels<K, V>(self, labels: impl IntoIterator<Item = (K, V)>) -> Self
where K: Serialize + Eq + Hash, V: Serialize,

Key-value pairs that are used to add metadata to a pod.

Source

pub fn mounts(self, mounts: impl IntoIterator<Item = Mount>) -> Self

Mounts are mounts that will be added to the pod. These will supersede image_volumes and volumes_from volumes where there are conflicts.

Source

pub fn name(self, name: impl Serialize) -> Self

The name of the pod. If not provided, a name will be generated when the pod is created.

Source

pub fn netns(self, netns: Namespace) -> Self

Source

pub fn network_options<K, V>( self, network_options: impl IntoIterator<Item = (K, V)>, ) -> Self
where K: Serialize + Eq + Hash, V: Serialize,

Additional options for each network.

Source

pub fn no_infra(self, no_infra: bool) -> Self

tells the pod not to create an infra container. If this is done, many networking-related options will become unavailable. Conflicts with any network or infra related settings.

Source

pub fn no_manage_hosts(self, no_manage_hosts: bool) -> Self

Indicates that /etc/hosts should not be managed by the pod. Instead, each container will create a separate /etc/hosts as they would if not in a pod. Conflicts with add_hosts.

Source

pub fn no_manage_resolv_conf(self, no_manage_resolv_conf: bool) -> Self

Indicates that /etc/resolv.conf should not be managed by the pod. Instead, each container will create and manage a separate resolv.conf as if they had not joined a pod. Conflicts with dns_server, dns_search, dns_option, no_infra.

Source

pub fn overlay_volumes( self, overlay_volumes: impl IntoIterator<Item = OverlayVolume>, ) -> Self

Overlay volumes are named volumes that will be added to the pod.

Source

pub fn pidns(self, pidns: Namespace) -> Self

Source

pub fn pod_create_command<S>( self, pod_create_command: impl IntoIterator<Item = S>, ) -> Self
where S: Serialize,

The command used to create this pod. This will be shown in the output of Inspect() on the pode and may also be used by some tools that wish to recreate the pod (e.g. podman generate systemd –new).

Source

pub fn pod_devices<S>(self, pod_devices: impl IntoIterator<Item = S>) -> Self
where S: Serialize,

User specified Devices to be added to the Pod.

Source

pub fn portmappings( self, portmappings: impl IntoIterator<Item = PortMapping>, ) -> Self

PortMappings is a set of ports to map into the infra container. As, by default, containers share their network with the infra container, this will forward the ports to the entire pod. Only available if NetNS is set to Bridge or Slirp.

Source

pub fn resource_limits(self, resource_limits: LinuxResources) -> Self

Container runtime resource constraints.

Source

pub fn security_opt<S>(self, security_opt: impl IntoIterator<Item = S>) -> Self
where S: Serialize,

Source

pub fn service_container_id<S>( self, service_container_id: impl IntoIterator<Item = S>, ) -> Self
where S: Serialize,

The ID of the pod’s service container.

Source

pub fn share_parent(self, share_parent: bool) -> Self

ShareParent determines if all containers in the pod will share the pod’s cgroup as the cgroup parent.

Source

pub fn shared_namespaces<S>( self, shared_namespaces: impl IntoIterator<Item = S>, ) -> Self
where S: Serialize,

Instructs the pod to share a set of namespaces. Shared namespaces will be joined (by default) by every container which joins the pod. If not set and NoInfra is false, the pod will set a default set of namespaces to share. Conflicts with no_infra == true.

Source

pub fn shm_size(self, shm_size: i64) -> Self

The size of the tmpfs to mount in at /dev/shm, in bytes.

Source

pub fn userns(self, userns: Namespace) -> Self

Source

pub fn utsns(self, utsns: Namespace) -> Self

Source

pub fn volumes(self, volumes: impl IntoIterator<Item = NamedVolume>) -> Self

Volumes are named volumes that will be added to the pod. These will supersede image_volumes and volumes_from volumes where there are conflicts.

Source

pub fn volumes_from<S>(self, volumes_from: impl IntoIterator<Item = S>) -> Self
where S: Serialize,

Set of containers whose volumes will be added to this pod. The name or ID of the container must be provided, and may optionally be followed by a : and then one or more comma-separated options. Valid options are ‘ro’, ‘rw’, and ‘z’. Options will be used for all volumes sourced from the container.

Trait Implementations§

Source§

impl Clone for PodCreateOptsBuilder

Source§

fn clone(&self) -> PodCreateOptsBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PodCreateOptsBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PodCreateOptsBuilder

Source§

fn default() -> PodCreateOptsBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,