Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultConfDir is the default dir where configurations are found DefaultConfDir = "/etc/cni/net.d/nv-ipam.d" // DefaultDaemonSocket is the default socket path for the daemon DefaultDaemonSocket = "unix:///var/lib/cni/nv-ipam/daemon.sock" // DefaultDaemonCallTimeoutSeconds is the default timeout IPAM daemon calls DefaultDaemonCallTimeoutSeconds = 5 // DefaultLogFile default log file path to be used for logging DefaultLogFile = "/var/log/nv-ipam-cni.log" // DefaultLogLevel is the default log level DefaultLogLevel = "info" // ConfFileName is the name of CNI configuration file found in conf dir ConfFileName = "nv-ipam.conf" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfLoader ¶ added in v0.0.3
type ConfLoader interface { // LoadConf loads configuration from CNI CmdArgs LoadConf(args *skel.CmdArgs) (*NetConf, error) }
ConfLoader loads CNI configuration
func NewConfLoader ¶ added in v0.0.3
func NewConfLoader() ConfLoader
type IPAMArgs ¶ added in v0.2.0
type IPAMArgs struct { IPs []string `json:"ips"` PoolNames []string `json:"poolNames"` PoolType string `json:"poolType"` AllocateDefaultGateway bool `json:"allocateDefaultGateway"` AllocateIPWithIndex *int32 `json:"allocateIPWithIndex"` }
IPAMArgs holds arguments from stdin args["cni"]
type IPAMConf ¶
type IPAMConf struct { types.IPAM // ForcePoolName if set, specifying PoolName in CNI call is mandatory and will // not be derrived from the network name. ForcePoolName *bool `json:"forcePoolName,omitempty"` // PoolName is the name of the pool to be used to allocate IP PoolName string `json:"poolName,omitempty"` // PoolType is the type of the pool which is referred by the PoolName, // supported values: ippool, cidrpool PoolType string `json:"poolType,omitempty"` // Address of the NVIDIA-ipam DaemonSocket DaemonSocket string `json:"daemonSocket,omitempty"` DaemonCallTimeoutSeconds int `json:"daemonCallTimeoutSeconds,omitempty"` ConfDir string `json:"confDir,omitempty"` LogFile string `json:"logFile,omitempty"` LogLevel string `json:"logLevel,omitempty"` // internal fields // holds processed data from poolName field Pools []string `json:"-"` // k8s metadata parsed from CNI_ARGS K8SMetadata struct { PodName string PodNamespace string PodUID string } `json:"-"` // requested IPs from CNI_ARGS, args and capabilities RequestedIPs []net.IP `json:"-"` // internal representation of the requested features Features struct { // request to allocate pool's default gateway as // interface IP address for the container AllocateDefaultGateway bool // request IP with the given index in the chunk allocated // for the particular node as interface IP address for // the container AllocateIPWithIndex *int32 } `json:"-"` }
IPAMConf is the configuration supported by our CNI plugin
type IPAMEnvArgs ¶ added in v0.2.0
type IPAMEnvArgs struct { types.CommonArgs IP types.UnmarshallableString K8S_POD_NAME types.UnmarshallableString //nolint K8S_POD_NAMESPACE types.UnmarshallableString //nolint K8S_POD_UID types.UnmarshallableString //nolint }
IPAMEnvArgs holds arguments from CNI_ARGS env variable
type NetConf ¶
type NetConf struct { Name string `json:"name"` CNIVersion string `json:"cniVersion"` IPAM *IPAMConf `json:"ipam"` DeviceID string `json:"deviceID"` RuntimeConfig struct { IPs []string `json:"ips,omitempty"` } `json:"runtimeConfig,omitempty"` Args *struct { ArgsCNI *IPAMArgs `json:"cni"` } `json:"args"` }
NetConf is CNI network config
Click to show internal directories.
Click to hide internal directories.