types

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfDir is the default dir where configurations are found
	DefaultConfDir = "/etc/cni/net.d/nv-ipam.d"
	// DefaultDataDir is the default dir where cni stores data and binaries
	DefaultDataDir = "/var/lib/cni/nv-ipam"
	// DefaultLogFile default log file path to be used for logging
	DefaultLogFile = "/var/log/nv-ipam-cni.log"

	// HostLocalDataDir is the relative path within the data dir for host-local state data
	HostLocalDataDir = "state/host-local"
	// K8sNodeNameFile is the file name containing k8s node name
	K8sNodeNameFile = "k8s-node-name"
	// DefaultKubeConfigFileName is the default name of kubeconfig file
	DefaultKubeConfigFileName = "nv-ipam.kubeconfig"
	// 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 CNI configuration from Json data
	LoadConf(bytes []byte) (*NetConf, error)
}

ConfLoader loads CNI configuration

func NewConfLoader added in v0.0.3

func NewConfLoader() ConfLoader

type HostLocalIPAMConfig

type HostLocalIPAMConfig struct {
	Type    string              `json:"type"`
	DataDir string              `json:"dataDir"`
	Ranges  []HostLocalRangeSet `json:"ranges"`
}

type HostLocalNetConf

type HostLocalNetConf struct {
	Name       string               `json:"name"`
	CNIVersion string               `json:"cniVersion"`
	IPAM       *HostLocalIPAMConfig `json:"ipam"`
}

func HostLocalNetConfFromNetConfAndPool

func HostLocalNetConfFromNetConfAndPool(nc *NetConf, p *pool.IPPool) *HostLocalNetConf

type HostLocalRange

type HostLocalRange struct {
	RangeStart string `json:"rangeStart,omitempty"` // The first ip, inclusive
	RangeEnd   string `json:"rangeEnd,omitempty"`   // The last ip, inclusive
	Subnet     string `json:"subnet"`
	Gateway    string `json:"gateway,omitempty"`
}

type HostLocalRangeSet

type HostLocalRangeSet []HostLocalRange

type IPAMConf

type IPAMConf struct {
	types.IPAM

	// PoolName is the name of the pool to be used to allocate IP
	PoolName   string `json:"poolName,omitempty"`
	Kubeconfig string `json:"kubeconfig,omitempty"`
	DataDir    string `json:"dataDir,omitempty"`
	ConfDir    string `json:"confDir,omitempty"`
	LogFile    string `json:"logFile,omitempty"`
	LogLevel   string `json:"logLevel,omitempty"`

	// internal configuration
	NodeName  string
	K8sClient kubernetes.Interface
}

IPAMConf is the configuration supported by our CNI plugin

type NetConf

type NetConf struct {
	Name       string    `json:"name"`
	CNIVersion string    `json:"cniVersion"`
	IPAM       *IPAMConf `json:"ipam"`
}

NetConf is CNI network config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL