hostagent

package
v0.0.0-...-9647dda Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 93 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FabricDiscoveryMethodLLDPNMState = iota
	FabricDiscoveryMethodLLDPRawSocket
	FabricDiscoveryMethodStatic
)
View Source
const (
	PrimaryCNISRIOV           = "sriov"
	PrimaryCNIMACVLAN         = "macvlan"
	PrimaryCNIBridge          = "bridge"
	PrimaryCNIOpenShiftBridge = "cnv-bridge"
	PrimaryCNIIPVLAN          = "ipvlan"
	PrimaryCNIOVS             = "ovs"
	PrimaryCNIUnk             = "nothandled"
)
View Source
const (
	DefaultSessionAffinityTimer = 10800
	TempSessionAffinityTimer    = 1
)

Default Session value is 10800(for 3 hours)

View Source
const (
	ACIContainersTaintName string = "aci-containers-host/unavailable"
)

Name of the taint set by Controller

View Source
const DHCLIENT_CONF = "/usr/local/etc/dhclient.conf"
View Source
const NullMac = "null-mac"
View Source
const (
	OpenShiftIngressNs string = "openshift-ingress"
)

Namespace of Openshift Service

View Source
const (
	PrivateMACPrefixString = "0a:58"
)
View Source
const (
	RouterInternalDefault string = "router-internal-default"
)

Name of the Openshift Service

View Source
const SnatService = "snat-external"

Filename used to create external service file on host example snat-external.service

Variables

View Source
var (
	ErrLLDPAdjacency             = errors.New("LLDP adjacency with ACI fabric not found")
	ErrNoAllocatableVlan         = errors.New("No encap specified/derivable for network-attachment-definition")
	ErrNoAllocatableVlanUntagged = errors.New("Invalid Encap for untagged network-attachment-definition")
	ErrMultipleEncapUntagged     = errors.New("Multiple encap specified/derivable for untagged network-attachment-definition")
)
View Source
var (
	// private mac prefix safe to use
	PrivateMACPrefix = []byte{0x0a, 0x58}
)
View Source
var Version = map[string]bool{
	"openshift-4.6-baremetal":              true,
	"openshift-4.7-baremetal":              true,
	"openshift-4.8-baremetal":              true,
	"openshift-4.9-baremetal":              true,
	"openshift-4.10-baremetal":             true,
	"openshift-4.11-baremetal":             true,
	"openshift-4.12-baremetal":             true,
	"openshift-4.13-baremetal":             true,
	"openshift-4.14-baremetal":             true,
	"openshift-4.14-agent-based-baremetal": true,
	"openshift-4.4-esx":                    true,
	"openshift-4.5-esx":                    true,
	"openshift-4.6-esx":                    true,
	"openshift-4.7-esx":                    true,
	"openshift-4.8-esx":                    true,
	"openshift-4.9-esx":                    true,
	"openshift-4.10-esx":                   true,
	"openshift-4.11-esx":                   true,
	"openshift-4.12-esx":                   true,
	"openshift-4.13-esx":                   true,
	"openshift-4.14-esx":                   true,
	"openshift-4.14-agent-based-esx":       true,
}

Functions

func GenerateHardwareAddr4

func GenerateHardwareAddr4(ip net.IP, prefix []byte) (net.HardwareAddr, error)

https://github.com/containernetworking/plugins/blob/v0.9.1/pkg/utils/hwaddr/hwaddr.go#L45 Reusing code as the fn is removed in v1.0.0 GenerateHardwareAddr4 generates 48 bit virtual mac addresses based on the IP4 input.

func SetHWAddrByIP

func SetHWAddrByIP(ifName string, ip4, ip6 net.IP) error

https://github.com/containernetworking/plugins/blob/v0.9.1/pkg/ip/link_linux.go#L228 Reusing code as the fn is removed in v1.0.0

func SnatGlobalInfoLogger

func SnatGlobalInfoLogger(log *logrus.Logger, snat *snatglobal.SnatGlobalInfo) *logrus.Entry

func StartPlugin

func StartPlugin(log *logrus.Logger)

func StringFromInfo

func StringFromInfo(ver *VersionInfo) string

StringFromInfo prints the versioning details

func VersionString

func VersionString() string

String returns printable version string

Types

type ClearVethArgs

type ClearVethArgs struct {
	Sandbox string
	IfName  string
}

type ClearVfArgs

type ClearVfArgs struct {
	Sandbox       string
	IfName        string
	SriovDeviceId string
	VfNetDev      string
}

type ClientInfo

type ClientInfo struct {
	NetClient netattclient.K8sCniCncfIoV1Interface
}

type ClientRPC

type ClientRPC struct{}

func (*ClientRPC) ClearVeth

func (c *ClientRPC) ClearVeth(args *ClearVethArgs, ack *bool) error

func (*ClientRPC) ClearVf

func (c *ClientRPC) ClearVf(args *ClearVfArgs, ack *bool) error

func (*ClientRPC) SetupNetwork

func (*ClientRPC) SetupNetwork(args *SetupNetworkArgs, ack *bool) error

func (*ClientRPC) SetupVeth

func (*ClientRPC) SetupVeth(args *SetupVethArgs, result *SetupVethResult) error

func (*ClientRPC) SetupVf

func (*ClientRPC) SetupVf(args *SetupVfArgs, result *SetupVfResult) error

type Cloner

type Cloner struct {
	Stub bool
}

Cloner encapsulate a binary cloner for executing in a different process context

var PluginCloner Cloner

type Config

type Config struct {
	Name       string    `json:"name"`
	Plugins    []Plugins `json:"plugins"`
	CniVersion string    `json:"cniVersion"`
}

type DeviceInfo

type DeviceInfo struct {
	DeviceId     string
	ResourceName string
}

type Environment

type Environment interface {
	Init(agent *HostAgent) error
	PrepareRun(stopCh <-chan struct{}) (bool, error)

	CniDeviceChanged(metadataKey *string, id *md.ContainerId)
	CniDeviceDeleted(metadataKey *string, id *md.ContainerId)

	CheckPodExists(metadataKey *string) (bool, error)
	CheckNetAttDefExists(netAttDefKey string) (bool, error)
}

type EpRPC

type EpRPC struct {
	// contains filtered or unexported fields
}

func NewEpRPC

func NewEpRPC(agent *HostAgent) *EpRPC

func (*EpRPC) Register

func (r *EpRPC) Register(metadata *md.ContainerMetadata, result *cnitypes.Result) error

func (*EpRPC) Resync

func (r *EpRPC) Resync(args ResyncArgs, ack *bool) error

func (*EpRPC) Unregister

func (r *EpRPC) Unregister(metadata *md.ContainerMetadata, ack *bool) error

type EventPoster

type EventPoster struct {
	// contains filtered or unexported fields
}

type ExplicitKey

type ExplicitKey string

type FabricAttachmentData

type FabricAttachmentData struct {
	StaticPath string `json:"staticPath"`
	SystemName string `json:"systemName"`
}

type FabricDiscoveryAgent

type FabricDiscoveryAgent interface {
	Init(agent *HostAgent) error
	CollectDiscoveryData(stopCh <-chan struct{})
	TriggerCollectionDiscoveryData()
	GetNeighborData(iface string) ([]*FabricAttachmentData, error)
	PopulateAdjacencies(adjs map[string][]FabricAttachmentData)
}

func NewFabricDiscoveryAgentLLDPNMState

func NewFabricDiscoveryAgentLLDPNMState() FabricDiscoveryAgent

func NewFabricDiscoveryAgentLLDPRawSocket

func NewFabricDiscoveryAgentLLDPRawSocket() FabricDiscoveryAgent

type FabricDiscoveryAgentLLDPNMState

type FabricDiscoveryAgentLLDPNMState struct {
	LLDPIntfMap     map[string]*LLDPInterfaceState
	LLDPNeighborMap map[string]map[string][]FabricAttachmentData
	// contains filtered or unexported fields
}

func (*FabricDiscoveryAgentLLDPNMState) CollectDiscoveryData

func (agent *FabricDiscoveryAgentLLDPNMState) CollectDiscoveryData(stopCh <-chan struct{})

func (*FabricDiscoveryAgentLLDPNMState) GetNeighborData

func (agent *FabricDiscoveryAgentLLDPNMState) GetNeighborData(iface string) ([]*FabricAttachmentData, error)

func (*FabricDiscoveryAgentLLDPNMState) Init

func (*FabricDiscoveryAgentLLDPNMState) PopulateAdjacencies

func (agent *FabricDiscoveryAgentLLDPNMState) PopulateAdjacencies(adjs map[string][]FabricAttachmentData)

func (*FabricDiscoveryAgentLLDPNMState) RunCommand

func (agent *FabricDiscoveryAgentLLDPNMState) RunCommand(cmd string, cmdArgs ...string) ([]byte, error)

func (*FabricDiscoveryAgentLLDPNMState) TriggerCollectionDiscoveryData

func (agent *FabricDiscoveryAgentLLDPNMState) TriggerCollectionDiscoveryData()

type FabricDiscoveryAgentLLDPRawSocket

type FabricDiscoveryAgentLLDPRawSocket struct{}

func (*FabricDiscoveryAgentLLDPRawSocket) CollectDiscoveryData

func (agent *FabricDiscoveryAgentLLDPRawSocket) CollectDiscoveryData(stopChain <-chan struct{})

func (*FabricDiscoveryAgentLLDPRawSocket) GetNeighborData

func (agent *FabricDiscoveryAgentLLDPRawSocket) GetNeighborData(iface string) ([]*FabricAttachmentData, error)

func (*FabricDiscoveryAgentLLDPRawSocket) Init

func (*FabricDiscoveryAgentLLDPRawSocket) PopulateAdjacencies

func (agent *FabricDiscoveryAgentLLDPRawSocket) PopulateAdjacencies(adjs map[string][]FabricAttachmentData)

func (*FabricDiscoveryAgentLLDPRawSocket) TriggerCollectionDiscoveryData

func (agent *FabricDiscoveryAgentLLDPRawSocket) TriggerCollectionDiscoveryData()

type GroupDefaults

type GroupDefaults struct {
	// Default endpoint group annotation value
	DefaultEg metadata.OpflexGroup `json:"default-endpoint-group,omitempty"`

	// Default security group annotation value
	DefaultSg []metadata.OpflexGroup `json:"default-security-group,omitempty"`

	// Default qospolicy group annotation value
	DefaultQp metadata.OpflexGroup `json:"default-qospolicy-group,omitempty"`

	// Override default endpoint group assignments for a namespace
	// map ns name -> group
	NamespaceDefaultEg map[string]metadata.OpflexGroup `json:"namespace-default-endpoint-group,omitempty"`

	// Override default security group assignments for namespaces
	// map ns name -> slice of groups
	NamespaceDefaultSg map[string][]metadata.OpflexGroup `json:"namespace-default-security-group,omitempty"`

	// Override default qospolicy group assignments for a namespace
	// map ns name -> group
	NamespaceDefaultQp map[string]metadata.OpflexGroup `json:"namespace-default-qospolicy-group,omitempty"`
}

type HostAgent

type HostAgent struct {
	// contains filtered or unexported fields
}

func NewHostAgent

func NewHostAgent(config *HostAgentConfig, env Environment, log *logrus.Logger) *HostAgent

func (*HostAgent) DeleteMatchingSnatPolicyLabel

func (agent *HostAgent) DeleteMatchingSnatPolicyLabel(policy string)

func (*HostAgent) DeleteNetworkMetadata

func (agent *HostAgent) DeleteNetworkMetadata(netAttData *NetworkAttachmentData)

func (*HostAgent) DeleteSnatPolicyLabel

func (agent *HostAgent) DeleteSnatPolicyLabel(key string)

func (*HostAgent) DeleteSnatPolicyLabelEntry

func (agent *HostAgent) DeleteSnatPolicyLabelEntry(key, policy string)

func (*HostAgent) EPRegAdd

func (agent *HostAgent) EPRegAdd(ep *opflexEndpoint) bool

func (*HostAgent) EPRegDelEP

func (agent *HostAgent) EPRegDelEP(name string)

func (*HostAgent) EnableSync

func (agent *HostAgent) EnableSync() (changed bool)

func (*HostAgent) FabricDiscoveryCollectDiscoveryData

func (ha *HostAgent) FabricDiscoveryCollectDiscoveryData(stopCh <-chan struct{})

func (*HostAgent) FabricDiscoveryPopulateAdjacencies

func (ha *HostAgent) FabricDiscoveryPopulateAdjacencies(method int, adjs map[string][]FabricAttachmentData)

func (*HostAgent) FabricDiscoveryRegistryInit

func (ha *HostAgent) FabricDiscoveryRegistryInit() (err error)

TBD: Consider passing a profile to make sure only the required methods are run

func (*HostAgent) FabricDiscoveryTriggerCollectionDiscoveryData

func (ha *HostAgent) FabricDiscoveryTriggerCollectionDiscoveryData()

func (*HostAgent) FormEPFilePath

func (agent *HostAgent) FormEPFilePath(uuid string) string

func (*HostAgent) FormRdFilePath

func (agent *HostAgent) FormRdFilePath() string

func (*HostAgent) FormSnatFilePath

func (agent *HostAgent) FormSnatFilePath(uuid string) string

func (*HostAgent) GetFabricDiscoveryNeighborDataLocked

func (ha *HostAgent) GetFabricDiscoveryNeighborDataLocked(iface string) ([]*FabricAttachmentData, error)

func (*HostAgent) InformNodeInfo

func (agent *HostAgent) InformNodeInfo(nodeInfoClient *nodeInfoclientset.Clientset, snatpolicies map[string]bool) bool

func (*HostAgent) Init

func (agent *HostAgent) Init()

func (*HostAgent) LoadAdditionalNetworkMetadata

func (agent *HostAgent) LoadAdditionalNetworkMetadata() error

func (*HostAgent) LoadCniNetworks

func (agent *HostAgent) LoadCniNetworks() error

func (*HostAgent) MetaNamespaceUIDFunc

func (agent *HostAgent) MetaNamespaceUIDFunc(obj interface{}) (string, error)

func (*HostAgent) NodeEPRegAdd

func (agent *HostAgent) NodeEPRegAdd(nodePodIfEPs map[string]*opflexEndpoint) bool

func (*HostAgent) NotifyFabricAdjacency

func (agent *HostAgent) NotifyFabricAdjacency(iface string, fabAttData []*FabricAttachmentData)

func (*HostAgent) ReadSnatPolicyLabel

func (agent *HostAgent) ReadSnatPolicyLabel(key string) (map[string]ResourceType, bool)

func (*HostAgent) RecordNetworkMetadata

func (agent *HostAgent) RecordNetworkMetadata(netAttData *NetworkAttachmentData) error

func (*HostAgent) Run

func (agent *HostAgent) Run(stopCh <-chan struct{})

func (*HostAgent) RunPacketEventListener

func (agent *HostAgent) RunPacketEventListener(stopCh <-chan struct{})

func (*HostAgent) RunStatus

func (agent *HostAgent) RunStatus()

func (*HostAgent) ScheduleSync

func (agent *HostAgent) ScheduleSync(syncType string)

func (*HostAgent) UpdateLocalInfoCr

func (agent *HostAgent) UpdateLocalInfoCr() bool

func (*HostAgent) WriteNewSnatPolicyLabel

func (agent *HostAgent) WriteNewSnatPolicyLabel(key string)

func (*HostAgent) WriteSnatPolicyLabel

func (agent *HostAgent) WriteSnatPolicyLabel(key, policy string, res ResourceType)

type HostAgentConfig

type HostAgentConfig struct {
	HostAgentNodeConfig
	GroupDefaults

	// Run as child mode for executing network namespace commands in a
	// separate process.
	ChildMode bool `json:"child-mode,omitempty"`

	// Log level
	LogLevel string `json:"log-level,omitempty"`

	// Absolute path to a kubeconfig file
	KubeConfig string `json:"kubeconfig,omitempty"`

	// Name of Kubernetes node on which this agent is running
	NodeName string `json:"node-name,omitempty"`

	// TCP port to run status server on (or 0 to disable)
	StatusPort int `json:"status-port,omitempty"`

	// TCP port for opflex server to connect
	GRPCPort int `json:"grpc-port,omitempty"`

	// Directory containing OpFlex CNI metadata
	CniMetadataDir string `json:"cni-metadata-dir,omitempty"`

	// Name of the CNI network
	CniNetwork string `json:"cni-network,omitempty"`

	// Directory for writing CNI network metadata
	CniNetworksDir string `json:"cni-networks-dir,omitempty"`

	// Directory for writing Opflex configuration
	OpFlexConfigPath string `json:"opflex-config-path,omitempty"`

	// Directory for writing OpFlex endpoint metadata
	OpFlexEndpointDir string `json:"opflex-endpoint-dir,omitempty"`

	// Directory for writing OpFlex service metadata
	OpFlexServiceDir string `json:"opflex-service-dir,omitempty"`

	// Directory for writing OpFlex snat metadata
	OpFlexSnatDir string `json:"opflex-snat-dir,omitempty"`

	// Directory for writing OpFlex fault metadata
	OpFlexFaultDir string `json:"opflex-fault-dir,omitempty"`

	// OpFlex agent's flow-ID cache directory
	OpFlexFlowIdCacheDir string `json:"opflex-flowid-cache-dir,omitempty"`

	// Multicast groups file used by OpFlex agent
	OpFlexMcastFile string `json:"opflex-mcast-file,omitempty"`

	// File for writing Opflex server configuration
	OpFlexServerConfigFile string `json:"opflex-server-config-file,omitempty"`

	// Location of the packet event notification socket which listens to opflex-agent packet events
	PacketEventNotificationSock string `json:"packet-event-notification-socket,omitempty"`

	// Directory for drop log config
	OpFlexDropLogConfigDir string `json:"opflex-drop-log-config-dir,omitempty"`

	// RemoteIp for opflex drop logger
	OpFlexDropLogRemoteIp string `json:"opflex-drop-log-remote-ip,omitempty"`

	// Location of the OVS DB socket
	OvsDbSock string `json:"ovs-db-sock,omitempty"`

	// Location of the endpoint RPC socket used for communicating with
	// the CNI plugin
	EpRpcSock string `json:"ep-rpc-sock,omitempty"`

	// Permissions to set for endpoint RPC socket file. Octal string.
	EpRpcSockPerms string `json:"ep-rpc-sock-perms,omitempty"`

	// AciPrefix is used for generating aci names
	AciPrefix string `json:"aci-prefix,omitempty"`

	// Vlan used for ACI infrastructure traffic
	AciInfraVlan uint `json:"aci-infra-vlan,omitempty"`

	// VLAN for service traffic
	ServiceVlan uint `json:"service-vlan,omitempty"`

	// Type of encapsulation to use for uplink; either vlan or vxlan
	EncapType string `json:"encap-type,omitempty"`

	// Name of the OVS integration bridge
	IntBridgeName string `json:"int-bridge-name,omitempty"`

	// Name of the OVS access bridge
	AccessBridgeName string `json:"access-bridge-name,omitempty"`

	// Interface MTU to use when configuring container interfaces
	InterfaceMtu int `json:"interface-mtu,omitempty"`

	// Interface MTU headroom for VXLAN
	InterfaceMtuHeadroom int `json:"interface-mtu-headroom,omitempty"`

	// Configuration for CNI networks
	NetConfig []cniNetConfig `json:"cni-netconfig,omitempty"`

	// The type of the ACI VMM domain: either "Kubernetes"
	// or "OpenShift"
	AciVmmDomainType string `json:"aci-vmm-type,omitempty"`

	// The name of the ACI VMM domain
	AciVmmDomain string `json:"aci-vmm-domain,omitempty"`

	// The name of the ACI VMM domain controller instance
	AciVmmController string `json:"aci-vmm-controller,omitempty"`

	// ACI VRF for this kubernetes instance
	AciVrf string `json:"aci-vrf,omitempty"`

	// ACI Tenant containing the ACI VRF for this kubernetes instance
	AciVrfTenant string `json:"aci-vrf-tenant,omitempty"`

	// EP Registry specifies where to send ep updates
	EPRegistry string `json:"ep-registry,omitempty"`

	// EnableNodePodIF enabled
	EnableNodePodIF bool `json:"enable-nodepodif,omitempty"`

	// OpflexMode selects overlay vs physical fabric. Default is physical
	OpflexMode string `json:"opflex-mode,omitempty"`

	//ZoneId for Snat flows
	Zone uint `json:"zone,omitempty"`

	//Namespace for SNAT CRDs
	AciSnatNamespace string `json:"aci-snat-namespace,omitempty"`

	//DropLogging enabled
	EnableDropLogging bool `json:"enable-drop-log,omitempty"`

	// DropLog Interface connecting to access bridge
	DropLogAccessInterface string `json:"drop-log-access-iface,omitempty"`

	// DropLog Interface connecting to integration bridge
	DropLogIntInterface string `json:"drop-log-int-iface,omitempty"`

	// Droplogs older than the expiry-time will be discarded if not published
	DropLogExpiryTime uint `json:"drop-log-expiry,omitempty"`

	// More than one droplog within the repeat interval for the same event is suppressed
	DropLogRepeatIntervalTime uint `json:"drop-log-repeat-intvl,omitempty"`

	//default is false
	HppOptimization bool `json:"hpp-optimization,omitempty"`

	// If true, enable opflex agent reconnect after vm migration
	// Default is false
	EnableOpflexAgentReconnect bool `json:"enable-opflex-agent-reconnect,omitempty"`

	// Default is false
	AciMultipod bool `json:"aci-multipod,omitempty"`

	// Max number of time dhcp renew will be executed after multi pod vm migration
	DhcpRenewMaxRetryCount int `json:"dhcp-renew-max-retry-count,omitempty"`

	// Delay between dhcp release and renew in seconds
	DhcpDelay int `json:"dhcp-delay,omitempty"`

	// enable EndpointSlice
	EnabledEndpointSlice bool `json:"enable_endpointslice,omitempty"`
	// Cluster Flavour
	Flavor string `json:"flavor,omitempty"`
	// Installer lb Ip provisioned for Openshift on Esx
	InstallerProvlbIp string `json:"installer-provisioned-lb-ip,omitempty"`

	// Sriov and Ovs Hardward Offload enabled
	OvsHardwareOffload bool `json:"enable-ovs-hw-offload,omitempty"`

	// DpuOvsDBSocket when OpflexMode is dpu selects ovsdb sock on dpu
	DpuOvsDBSocket string `json:"dpu-ovsdb-socket,omitempty"`

	// chained mode enabled
	ChainedMode bool `json:"chained-mode,omitempty"`

	// enable chained operation on primary cni chain
	EnableChainedPrimary bool `json:"enable-chained-primary,omitempty"`

	// enable chained operation on secondary cni chain
	EnableChainedSecondary bool `json:"enable-chained-secondary,omitempty"`

	// Primary cni path
	PrimaryCniPath string `json:"primary-cni-path,omitempty"`

	//In chained mode, global l2 port policy has been configured, so enable shared vlan pool
	AciUseGlobalScopeVlan bool `json:"aci-use-global-scope-vlan,omitempty"`

	// Metrics
	EnableMetrics bool `json:"enable-metrics,omitempty"`
	MetricsPort   int  `json:"metrics-port,omitempty"`

	// Disable hpp rendering if set to true
	DisableHppRendering bool `json:"disable-hpp-rendering,omitempty"`

	// Enable/disable making node unschedulable when it's not ready
	TaintNotReadyNode bool `json:"taint-not-ready-node,omitempty"`
}

Configuration for the host agent

func (*HostAgentConfig) InitFlags

func (config *HostAgentConfig) InitFlags()

type HostAgentNodeConfig

type HostAgentNodeConfig struct {
	// Uplink interface for this host
	UplinkIface string `json:"uplink-iface,omitempty"`

	// Subinterface of uplink interface on AciInfraVlan
	VxlanIface string `json:"vxlan-iface,omitempty"`

	// Anycast IP used for unicast VXLAN packets
	VxlanAnycastIp string `json:"vxlan-anycast-ip,omitempty"`

	// Anycast IP used for OpFlex communication
	OpflexPeerIp string `json:"opflex-peer-ip,omitempty"`

	// Uplink Mac adress
	UplinkMacAdress string `json:"uplink mac_adress,omitempty"`

	// Registry Server URL -- for updating remote EP information
	RegistryURL string `json:"registry-url,omitempty"`
}

type IPAM

type IPAM struct {
	Type string `json:"type,omitempty"`
}

type K8sEnvironment

type K8sEnvironment struct {
	// contains filtered or unexported fields
}

func NewK8sEnvironment

func NewK8sEnvironment(config *HostAgentConfig, log *logrus.Logger) (*K8sEnvironment, error)

func (*K8sEnvironment) CheckNetAttDefExists

func (env *K8sEnvironment) CheckNetAttDefExists(netAttDefKey string) (bool, error)

func (*K8sEnvironment) CheckPodExists

func (env *K8sEnvironment) CheckPodExists(metadataKey *string) (bool, error)

func (*K8sEnvironment) CniDeviceChanged

func (env *K8sEnvironment) CniDeviceChanged(metadataKey *string, id *md.ContainerId)

func (*K8sEnvironment) CniDeviceDeleted

func (env *K8sEnvironment) CniDeviceDeleted(metadataKey *string, id *md.ContainerId)

func (*K8sEnvironment) Init

func (env *K8sEnvironment) Init(agent *HostAgent) error

func (*K8sEnvironment) PrepareRun

func (env *K8sEnvironment) PrepareRun(stopCh <-chan struct{}) (bool, error)

type LLDPInterfaceState

type LLDPInterfaceState struct {
	Enabled        bool
	InterfaceType  string
	AdminState     string
	IsOvsInterface bool
}

type NetworkAttachmentData

type NetworkAttachmentData struct {
	Name                 string
	Namespace            string
	IsPrimaryNetwork     bool
	Config               string
	Annot                string
	PrimaryCNI           PrimaryCNIType
	ResourcePlugin       string
	ResourceName         string
	Ifaces               []string
	EncapVlan            string
	FabricAttachmentData map[string][]*FabricAttachmentData
	Pods                 map[string]map[string]fabattv1.PodAttachment
	KnownAnnots          map[string]string
	EncapKey             string
	PluginVlan           string
	EncapMode            util.EncapMode
	PluginTrunk          []TrunkConfig
	Programmed           bool
	PluginAllowUntagged  bool
	Status               string
}

type OpflexPortRange

type OpflexPortRange struct {
	Start int `json:"start,omitempty"`
	End   int `json:"end,omitempty"`
}

type OpflexServerConfig

type OpflexServerConfig struct {
	GRPCAddress string `json:"grpc-address,omitempty"`
	DebugLevel  string `json:"level,omitempty"`
}

type OpflexSnatIp

type OpflexSnatIp struct {
	Uuid          string                   `json:"uuid"`
	InterfaceName string                   `json:"interface-name,omitempty"`
	SnatIp        string                   `json:"snat-ip,omitempty"`
	InterfaceMac  string                   `json:"interface-mac,omitempty"`
	Local         bool                     `json:"local,omitempty"`
	DestIpAddress []string                 `json:"dest,omitempty"`
	PortRange     []OpflexPortRange        `json:"port-range,omitempty"`
	InterfaceVlan uint                     `json:"interface-vlan,omitempty"`
	Zone          uint                     `json:"zone,omitempty"`
	Remote        []OpflexSnatIpRemoteInfo `json:"remote,omitempty"`
}

This structure is to write the SnatFile

type OpflexSnatIpRemoteInfo

type OpflexSnatIpRemoteInfo struct {
	NodeIp     string            `json:"snat_ip,omitempty"`
	MacAddress string            `json:"mac,omitempty"`
	PortRange  []OpflexPortRange `json:"port-range,omitempty"`
	Refcount   int               `json:"ref,omitempty"`
}

This Structure is to calculate remote Info

type PacketEvent

type PacketEvent struct {
	TimeStamp       string
	DropReason      string
	SourceMac       string
	DestinationMac  string
	EtherType       string
	SourceIP        string
	DestinationIP   string
	IPProto         string
	SourcePort      string
	DestinationPort string
}

type Plugins

type Plugins struct {
	Type             string        `json:"type,omitempty"`
	IPAM             IPAM          `json:"ipam,omitempty"`
	Vlan             int           `json:"vlan,omitempty"`
	IsDefaultGateway bool          `json:"isDefaultGateway,omitempty"`
	Trunk            []TrunkConfig `json:"vlanTrunk,omitempty"`
	Master           string        `json:"master,omitempty"`
	Bridge           string        `json:"bridge,omitempty"`
}

type PrimaryCNIType

type PrimaryCNIType string

type ResourceType

type ResourceType int
const (
	POD ResourceType = 1 << iota
	SERVICE
	DEPLOYMENT
	NAMESPACE
	CLUSTER
	INVALID
)

type ResyncArgs

type ResyncArgs struct{}

type ServiceEndPointType

type ServiceEndPointType interface {
	InitClientInformer(kubeClient *kubernetes.Clientset)
	Run(stopCh <-chan struct{})
	SetOpflexService(ofas *opflexService, as *v1.Service,
		external bool, key string, sp *v1.ServicePort) bool
}

type SetupNetworkArgs

type SetupNetworkArgs struct {
	Sandbox string
	IfName  string
	Result  *cnicur.Result
}

type SetupVethArgs

type SetupVethArgs struct {
	Sandbox string
	IfName  string
	Mtu     int
	Ip      net.IP
}

type SetupVethResult

type SetupVethResult struct {
	HostVethName string
	Mac          string
}

type SetupVfArgs

type SetupVfArgs struct {
	Sandbox       string
	IfName        string
	Mtu           int
	Ip            net.IP
	SriovDeviceId string
	OffloadMode   string
}

type SetupVfResult

type SetupVfResult struct {
	HostVfName string
	Mac        string
	VfNetDev   string
}

type SnatLocalInfo

type SnatLocalInfo struct {
	// contains filtered or unexported fields
}

type TrunkConfig

type TrunkConfig struct {
	Id    int `json:"id,omitempty"`
	MinID int `json:"minID,omitempty"`
	MaxID int `json:"maxID,omitempty"`
}

type VersionInfo

type VersionInfo struct {
	GitCommit string
	BuildTime string
}

Info enlists version and build information

func GetVersion

func GetVersion() *VersionInfo

Get gets the version information

Jump to

Keyboard shortcuts

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