Documentation ¶
Overview ¶
Package cni configures the Container Networking Interface
Index ¶
- Constants
- func ConfigureDefaultBridgeCNIs(r Runner, networkPlugin string) error
- func ConfigureLoopbackCNI(r Runner, disable bool) error
- func GenerateCiliumYAML() ([]byte, error)
- func IsDisabled(cc config.ClusterConfig) bool
- type Bridge
- type Calico
- type Cilium
- type Custom
- type Disabled
- type Flannel
- type KindNet
- type Manager
- type Runner
Constants ¶
const ( // DefaultPodCIDR is the default CIDR to use in minikube CNI's. DefaultPodCIDR = "10.244.0.0/16" // DefaultConfDir is the default CNI Config Directory path DefaultConfDir = "/etc/cni/net.d" )
Variables ¶
This section is empty.
Functions ¶
func ConfigureDefaultBridgeCNIs ¶ added in v1.29.0
ConfigureDefaultBridgeCNIs configures all default bridge CNIs on a node (designated by runner). If network plugin is set (could be, eg "cni" or "kubenet"), it will disable all default bridges to avoid conflicts. Otherwise, it will configure all default bridges to match DefaultPodCIDR subnet range. It's usually called before deploying new CNI and on node restarts, to avoid conflicts and flip-flopping of pods' ip addresses. It is caller's responsibility to restart container runtime for these changes to take effect.
func ConfigureLoopbackCNI ¶ added in v1.29.0
ConfigureLoopbackCNI configures loopback cni. If disable is true, sets extension of its config file in /etc/cni/net.d to "mk_disabled". Otherwise, ensures loopback cni has expected version ("1.0.0") and valid name ("loopback") in its config file in /etc/cni/net.d. Note: cri-o is leaving out name atm (https://github.com/cri-o/cri-o/pull/6273). Avoid errors like: - Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "..." network for pod "...": networkPlugin cni failed to set up pod "..." network: missing network name:, - failed to clean up sandbox container "..." network for pod "...": networkPlugin cni failed to teardown pod "..." network: missing network name] It is caller's responsibility to restart container runtime for these changes to take effect.
func GenerateCiliumYAML ¶ added in v1.24.0
GenerateCiliumYAML generates the .yaml file
func IsDisabled ¶ added in v1.16.0
func IsDisabled(cc config.ClusterConfig) bool
IsDisabled checks if CNI is disabled
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge is a simple CNI manager for single-node usage
type Calico ¶ added in v1.12.1
type Calico struct {
// contains filtered or unexported fields
}
Calico is the Calico CNI manager
type Cilium ¶ added in v1.12.1
type Cilium struct {
// contains filtered or unexported fields
}
Cilium is the Cilium CNI manager
type Custom ¶
type Custom struct {
// contains filtered or unexported fields
}
Custom is a CNI manager than applies a user-specified manifest
type Disabled ¶
type Disabled struct {
// contains filtered or unexported fields
}
Disabled is a CNI manager than does nothing
type Flannel ¶
type Flannel struct {
// contains filtered or unexported fields
}
Flannel is the Flannel CNI manager
type KindNet ¶
type KindNet struct {
// contains filtered or unexported fields
}
KindNet is the KindNet CNI manager