cni

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalicoConf

type CalicoConf struct {
	CNIVersion string `json:"cniVersion,omitempty"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	IPAM       struct {
		Name       string
		Type       string   `json:"type"`
		Subnet     string   `json:"subnet"`
		AssignIpv4 *string  `json:"assign_ipv4"`
		AssignIpv6 *string  `json:"assign_ipv6"`
		IPv4Pools  []string `json:"ipv4_pools,omitempty"`
		IPv6Pools  []string `json:"ipv6_pools,omitempty"`
	} `json:"ipam,omitempty"`
	MTU                  int               `json:"mtu"`
	Nodename             string            `json:"nodename"`
	NodenameFileOptional bool              `json:"nodename_file_optional"`
	DatastoreType        string            `json:"datastore_type"`
	EtcdEndpoints        string            `json:"etcd_endpoints"`
	EtcdDiscoverySrv     string            `json:"etcd_discovery_srv"`
	LogLevel             string            `json:"log_level"`
	FeatureControl       FeatureControl    `json:"feature_control"`
	EtcdScheme           string            `json:"etcd_scheme"`
	EtcdKeyFile          string            `json:"etcd_key_file"`
	EtcdCertFile         string            `json:"etcd_cert_file"`
	EtcdCaCertFile       string            `json:"etcd_ca_cert_file"`
	ContainerSettings    ContainerSettings `json:"container_settings,omitempty"`
	IncludeDefaultRoutes bool              `json:"include_default_routes,omitempty"`
}

CalicoConf stores the common network config for Calico CNI plugin

type ContainerSettings

type ContainerSettings struct {
	AllowIPForwarding bool `json:"allow_ip_forwarding"`
}

ContainerSettings contains configuration options to be configured inside the container namespace.

type FeatureControl

type FeatureControl struct {
	IPAddrsNoIpam bool `json:"ip_addrs_no_ipam"`
	FloatingIPs   bool `json:"floating_ips"`
}

FeatureControl is a struct which controls which features are enabled in Calico.

type HostLocalIPAMConfig

type HostLocalIPAMConfig struct {
	*Range
	Name       string
	Type       string         `json:"type"`
	Routes     []*types.Route `json:"routes"`
	DataDir    string         `json:"dataDir"`
	ResolvConf string         `json:"resolvConf"`
	Ranges     []RangeSet     `json:"ranges"`
	IPArgs     []net.IP       `json:"-"` // Requested IPs from CNI_ARGS and args
}

IPAMConfig represents the IP related network configuration. This nests Range because we initially only supported a single range directly, and wish to preserve backwards compatibility

type NetworkComponents

type NetworkComponents struct {
	ConfigName          string
	CalicoConfig        *CalicoConf
	HostLocalIPAMConfig *HostLocalIPAMConfig

	// other CNI plugins in the conflist.
	Plugins map[string]*libcni.NetworkConfig
}

func Parse

func Parse(cniConfig string) (NetworkComponents, error)

Parse loads CNI config into the components for all other handlers to use. No verification is done here beyond checking for valid json. Calico CNI is parsed into the special Calico CNI data type. All other CNI types

type Range

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

type RangeSet

type RangeSet []Range

Jump to

Keyboard shortcuts

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