node

package
v1.16.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionInsufficientIP = "InsufficientIP"
	ConditionOperationErr   = "OperationErr"
)
View Source
const (
	ControllerName = "multi-ip-node"

	// Event reasons
	EventAllocIPFailed      = "AllocIPFailed"
	EventSyncOpenAPISuccess = "SyncOpenAPISuccess"
	EventSyncOpenAPIFailed  = "SyncOpenAPIFailed"
	EventENICreated         = "ENICreated"
	EventENICreateFailed    = "ENICreateFailed"
	EventENIDeleted         = "ENIDeleted"
	EventENIDeleteFailed    = "ENIDeleteFailed"
)

Variables

View Source
var (
	// ResourcePoolTotal terway total source amount in the pool
	ResourcePoolTotal = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "gc_count_total",
			Help: "controlplane gc total",
		},
		[]string{"node"},
	)

	SyncOpenAPITotal = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "sync_openapi_count_total",
			Help: "controlplane sync data with openapi total",
		},
		[]string{"node"},
	)

	// ReconcileLatency records the latency of different reconcile methods
	ReconcileLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "controlplane_node_reconcile_latency_ms",
			Help:    "Latency of node controller reconcile methods in milliseconds",
			Buckets: []float64{10, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 30000, 60000},
		},
		[]string{"method", "node"},
	)
)
View Source
var EniOptions = map[eniTypeKey]*aliyunClient.CreateNetworkInterfaceOptions{
	// contains filtered or unexported fields
}
View Source
var EventCh = make(chan event.GenericEvent, 1000)

Functions

func IPUsage

func IPUsage(eniIP map[string]*networkv1beta1.IP) (int, int)

func IdlesWithAvailable

func IdlesWithAvailable(eniIP map[string]*networkv1beta1.IP) (count int)

func Notify added in v1.11.5

func Notify(ctx context.Context, name string)

Types

type Condition added in v1.10.0

type Condition string

type EniIP

type EniIP struct {
	NetworkInterface *networkv1beta1.Nic
	IP               *networkv1beta1.IP
}

type NodeStatus

type NodeStatus struct {
	NeedSyncOpenAPI   *atomic.Bool
	StatusChanged     *atomic.Bool
	LastGCTime        time.Time
	LastReconcileTime time.Time

	Mutex sync.Mutex
}

func MetaCtx

func MetaCtx(ctx context.Context) *NodeStatus

type PodRequest

type PodRequest struct {
	// requirements
	PodUID string

	RequireIPv4 bool
	RequireIPv6 bool

	RequireERDMA bool

	// status form pod status, only used in takeover
	IPv4 string
	IPv6 string
	// contains filtered or unexported fields
}

type ReconcileNode

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

func (*ReconcileNode) Reconcile

func (n *ReconcileNode) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Jump to

Keyboard shortcuts

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