fabric

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package fabric contains the logic to manage internal network fabric on each node.

Index

Constants

View Source
const (
	// FirewallCategoryTargetValue is the value used by the firewallconfiguration controller
	// to reconcile only resources related to netwok fabric.
	FirewallCategoryTargetValue = "fabric"
	// FirewallSubCategoryTargetAllNodesValue is the value used by the firewallconfiguration controller
	// to reconcile only resources related to netwok fabric on all nodes.
	FirewallSubCategoryTargetAllNodesValue = "all-nodes"
	// FirewallSubCategoryTargetSingleNodeValue is the value used by the firewallconfiguration controller
	// to reconcile only resources related to netwok fabric on a specific node.
	FirewallSubCategoryTargetSingleNodeValue = "single-node"
	// RouteCategoryTargetValue is the value used by the routecontroller to reconcile only resources related to network fabric.
	RouteCategoryTargetValue = "fabric"
)

Variables

View Source
var RequiredFlags = []FlagName{
	FlagNameNodeName,
}

RequiredFlags contains the list of the mandatory flags.

Functions

func ForgeFirewallTargetLabels

func ForgeFirewallTargetLabels() map[string]string

ForgeFirewallTargetLabels returns the labels used by the firewallconfiguration controller to reconcile only resources related to network fabric.

func ForgeFirewallTargetLabelsSingleNode

func ForgeFirewallTargetLabelsSingleNode(nodeName string) map[string]string

ForgeFirewallTargetLabelsSingleNode returns the labels used by the firewallconfiguration controller to reconcile only resources related to network fabric on a specific node.

func ForgeRouteTargetLabels

func ForgeRouteTargetLabels() map[string]string

ForgeRouteTargetLabels returns the labels used by the routecontroller to reconcile only resources related to network fabric.

func InitFlags

func InitFlags(flagset *pflag.FlagSet, opts *Options)

InitFlags initializes the flags for the wireguard tunnel.

func MarkFlagsRequired

func MarkFlagsRequired(cmd *cobra.Command) error

MarkFlagsRequired marks the flags as required.

Types

type FlagName

type FlagName string

FlagName is the type for the name of the flags.

const (
	// FlagNameNodeName is the name of the node where the pod is scheduled.
	FlagNameNodeName FlagName = "nodename"

	// FlagNameMetricsAddress is the address for the metrics endpoint.
	FlagNameMetricsAddress FlagName = "metrics-address"
	// FlagNameProbeAddr is the address for the health probe endpoint.
	FlagNameProbeAddr FlagName = "health-probe-bind-address"

	// FlagNameDisableARP is the flag to enable ARP.
	FlagNameDisableARP FlagName = "disable-arp"

	// FlagNameEnableNftMonitor is the flag to enable the nftables monitor.
	FlagNameEnableNftMonitor FlagName = "enable-nft-monitor"

	// FlagNameDisableKernelVersionCheck is the flag to enable the kernel version check.
	FlagNameDisableKernelVersionCheck FlagName = "disable-kernel-version-check"
	// FlagNameMinimumKernelVersion is the minimum kernel version required to run the wireguard interface.
	FlagNameMinimumKernelVersion FlagName = "minimum-kernel-version"

	// FlagNameGenevePort is the flag to set the Geneve port.
	FlagNameGenevePort FlagName = "geneve-port"
)

func (FlagName) String

func (fn FlagName) String() string

type InternalFabricReconciler

type InternalFabricReconciler struct {
	client.Client
	Scheme         *runtime.Scheme
	EventsRecorder record.EventRecorder
	Options        *Options
}

InternalFabricReconciler manage internalfabric.

func NewInternalFabricReconciler

func NewInternalFabricReconciler(cl client.Client, s *runtime.Scheme,
	er record.EventRecorder, opts *Options) (*InternalFabricReconciler, error)

NewInternalFabricReconciler returns a new InternalFabricReconciler.

func (*InternalFabricReconciler) Reconcile

Reconcile manage InternalFabrics.

func (*InternalFabricReconciler) SetupWithManager

func (r *InternalFabricReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager register the InternalFabricReconciler to the manager.

type Options

type Options struct {
	NodeName string
	PodName  string

	MetricsAddress string
	ProbeAddr      string

	DisableARP       bool
	EnableNftMonitor bool

	DisableKernelVersionCheck bool
	MinimumKernelVersion      kernelversion.KernelVersion

	GenevePort uint16
}

Options contains the options for the wireguard interface.

func NewOptions

func NewOptions() *Options

NewOptions returns a new Options struct.

Directories

Path Synopsis
Package sourcedetector contains the logic to detect the source IP used by nodes to contact pods.
Package sourcedetector contains the logic to detect the source IP used by nodes to contact pods.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳