gcmanager

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

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 {
	LogLevel                  string
	EnableGCIP                bool
	EnableGCForTerminatingPod bool
	ReleaseIPWorkerNum        int
	GCIPChannelBuffer         int
	MaxPodEntryDatabaseCap    int
	DefaultGCIntervalDuration time.Duration
	TracePodGapDuration       time.Duration
	GCSignalTimeoutDuration   time.Duration
	GCSignalGapDuration       time.Duration
	AdditionalGraceDelay      time.Duration
}

type PodDBer

type PodDBer interface {
	GetPodEntry(podName, namespace string) PodEntry
	DeletePodEntry(podName, namespace 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(podName, namespace string)

func (*PodDatabase) GetPodEntry

func (p *PodDatabase) GetPodEntry(podName, namespace string) PodEntry

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 {
	KClient client.Client
	PodDB   PodDBer
	// contains filtered or unexported fields
}

func (*SpiderGC) GetPodDatabase

func (s *SpiderGC) GetPodDatabase() PodDBer

func (*SpiderGC) Health

func (s *SpiderGC) Health()

func (*SpiderGC) Reconcile

func (s *SpiderGC) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile notice: if reconcile received an error, then the correspond request will requeue.

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