podman_rest_client/v5/models/pod_network_config.rs
1use serde::{Deserialize, Serialize};
2#[derive(Default, Debug, Serialize, Deserialize)]
3/// PodNetworkConfig contains networking configuration for a pod.
4pub struct PodNetworkConfig {
5 /// Map of networks names to ids the container should join to.
6 /// You can request additional settings for each network, you can
7 /// set network aliases, static ips, static mac address and the
8 /// network interface name for this container on the specific network.
9 /// If the map is empty and the bridge network mode is set the container
10 /// will be joined to the default network.
11 #[serde(rename = "Networks")]
12 pub networks: Option<std::collections::HashMap<String, crate::v5::models::PerNetworkOptions>>,
13 /// CNINetworks is a list of CNI networks to join the container to.
14 /// If this list is empty, the default CNI network will be joined
15 /// instead. If at least one entry is present, we will not join the
16 /// default network (unless it is part of this list).
17 /// Only available if NetNS is set to bridge.
18 /// Optional.
19 /// Deprecated: as of podman 4.0 use "Networks" instead.
20 pub cni_networks: Option<Vec<String>>,
21 /// DNSOption is a set of DNS options that will be used in the infra
22 /// container's resolv.conf, which will, by default, be shared with all
23 /// containers in the pod.
24 /// Conflicts with NoInfra=true.
25 /// Optional.
26 pub dns_option: Option<Vec<String>>,
27 /// DNSSearch is a set of DNS search domains that will be used in the
28 /// infra container's resolv.conf, which will, by default, be shared with
29 /// all containers in the pod.
30 /// If not provided, DNS search domains from the host's resolv.conf will
31 /// be used.
32 /// Conflicts with NoInfra=true.
33 /// Optional.
34 pub dns_search: Option<Vec<String>>,
35 /// DNSServer is a set of DNS servers that will be used in the infra
36 /// container's resolv.conf, which will, by default, be shared with all
37 /// containers in the pod.
38 /// If not provided, the host's DNS servers will be used, unless the only
39 /// server set is a localhost address. As the container cannot connect to
40 /// the host's localhost, a default server will instead be set.
41 /// Conflicts with NoInfra=true.
42 /// Optional.
43 pub dns_server: Option<Vec<String>>,
44 /// HostAdd is a set of hosts that will be added to the infra container's
45 /// etc/hosts that will, by default, be shared with all containers in
46 /// the pod.
47 /// Conflicts with NoInfra=true and NoManageHosts.
48 /// Optional.
49 pub hostadd: Option<Vec<String>>,
50 pub netns: Option<crate::v5::models::Namespace>,
51 /// NetworkOptions are additional options for each network
52 /// Optional.
53 pub network_options: Option<std::collections::HashMap<String, Vec<String>>>,
54 /// NoManageHosts indicates that /etc/hosts should not be managed by the
55 /// pod. Instead, each container will create a separate /etc/hosts as
56 /// they would if not in a pod.
57 /// Conflicts with HostAdd.
58 pub no_manage_hosts: Option<bool>,
59 /// NoManageResolvConf indicates that /etc/resolv.conf should not be
60 /// managed by the pod. Instead, each container will create and manage a
61 /// separate resolv.conf as if they had not joined a pod.
62 /// Conflicts with NoInfra=true and DNSServer, DNSSearch, DNSOption.
63 /// Optional.
64 pub no_manage_resolv_conf: Option<bool>,
65 /// PortMappings is a set of ports to map into the infra container.
66 /// As, by default, containers share their network with the infra
67 /// container, this will forward the ports to the entire pod.
68 /// Only available if NetNS is set to Bridge, Slirp, or Pasta.
69 /// Optional.
70 pub portmappings: Option<Vec<crate::v5::models::PortMapping>>,
71}