gcmanager

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

README

Spiderpool IP garbage collection

Notice

  • Current Tracing mechanism will not trace 'Terminating' time out pod if it's a StatefulSet pod, and the StatefulSet object was deleted or decreased its replicas.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCManager

type GCManager interface {
	Start(ctx context.Context) error

	GetPodDatabase() PodDBer

	TriggerGCAll()

	Health()
}

type GarbageCollectionConfig

type GarbageCollectionConfig struct {
	EnableGCIP                bool
	EnableGCForTerminatingPod bool
	EnableStatefulSet         bool

	ReleaseIPWorkerNum     int
	GCIPChannelBuffer      int
	MaxPodEntryDatabaseCap int

	DefaultGCIntervalDuration int
	TracePodGapDuration       int
	GCSignalTimeoutDuration   int
	GCSignalGapDuration       int
	AdditionalGraceDelay      int
}

type PodDBer

type PodDBer interface {
	DeletePodEntry(namespace, podName string)
	ApplyPodEntry(podEntry *PodEntry) error
	ListAllPodEntries() []PodEntry
}

func NewPodDBer

func NewPodDBer(maxDatabaseCap int) PodDBer

type PodDatabase

type PodDatabase struct {
	lock.RWMutex
	// contains filtered or unexported fields
}

PodDatabase represents controller PodEntry database

func (*PodDatabase) ApplyPodEntry

func (p *PodDatabase) ApplyPodEntry(podEntry *PodEntry) error

func (*PodDatabase) DeletePodEntry

func (p *PodDatabase) DeletePodEntry(namespace, podName string)

func (*PodDatabase) ListAllPodEntries

func (p *PodDatabase) ListAllPodEntries() []PodEntry

type PodEntry

type PodEntry struct {
	PodName   string
	Namespace string
	NodeName  string

	EntryUpdateTime time.Time

	TracingStartTime    time.Time
	TracingGracefulTime time.Duration
	TracingStopTime     time.Time

	PodTracingReason types.PodStatus
}

PodEntry represents a pod cache

type SpiderGC

type SpiderGC struct {
	PodDB PodDBer
	// contains filtered or unexported fields
}

func (*SpiderGC) GetPodDatabase

func (s *SpiderGC) GetPodDatabase() PodDBer

func (*SpiderGC) Health

func (s *SpiderGC) Health()

func (*SpiderGC) Start

func (s *SpiderGC) Start(ctx context.Context) error

func (*SpiderGC) TriggerGCAll

func (s *SpiderGC) TriggerGCAll()

Jump to

Keyboard shortcuts

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