Documentation ¶
Overview ¶
Package ipam provides options for IP address management (“IPAM”), making Docker's IPAM-related API data structures more accessible.
Usage ¶
The IPAM configuration options can be used in the context of creating a new custom Docker network as follows:
morbyd.NewNetwork(ctx, "my-custom-notwork", net.WithIPAM(ipam.WithPool("0.0.1.0/24", ipam.WithRange("0.0.1.16/28"))), )
Please note using github.com/thediveo/morbyd/net.WithIPAM for configuring an IPAM driver, including setting up multiple address pools by way of WithPool.
References ¶
For further background information on Docker IPAMs, please see:
- IPAM Drivers (Moby libnetwork documentation)
- builtin IPAM drivers (Moby libnetwork codebase)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPAM ¶
IPAM represents Docker's IPAM driver options, including IP address pool configuration, for creating a new custom Docker network.
type IPAMOpt ¶
IPAMOpt is a configuration option for configuring an IPAM driver (or “IPAM” for short).
func WithName ¶
WithName sets the name of the IPAM driver to use. When unset, it defaults to “default” (sic!), see also DefaultIPAM driver name in the Moby libnetwork codebase.
Please note that the “null” IPAM driver cannot be used with at least some of the network drivers, as these explicitly reject any attempt to use the “null” IPAM in order to not automatically assign any container IP addresses. A prominent example is the “macvlan” network driver.
func WithOption ¶
WithOption specifies a IPAM driver-specific option in “KEY=VALUE” format.
type Pool ¶
type Pool network.IPAMConfig
Pool represents an IP address pool, consisting of an IP subnet, and optionally an IP range inside the subnet to hand out addresses from, an optional default router IP address, and optional blocked (auxiliary) IP addresses.
type PoolOpt ¶
PoolOpt is a configuration option for an IP address pool.
func WithAuxAddress ¶
WithAuxAddress informs the IPAM driver of an IP address already in use in the network, so the driver must not allocate it to a container. In addition, this auxiliary IP address is assigned the specified hostname.
func WithGateway ¶
WithGateway specifies the default router's (“gateway” in IPv4 parlance) IP address.