pod

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 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 ContainerError

type ContainerError struct {
	Message       string
	ContainerName string
}

type ContainerErrorReport

type ContainerErrorReport struct {
	ContainerError
	PodStatus PodStatus
}

type ContainerLogChunk

type ContainerLogChunk struct {
	ContainerName string
	LogLines      []display.LogLine
}

type FailedReport

type FailedReport struct {
	FailedReason string
	PodStatus    PodStatus
}

type Feed

type Feed interface {
	OnAdded(func() error)
	OnSucceeded(func() error)
	OnFailed(func(string) error)
	OnReady(func() error)

	OnEventMsg(func(msg string) error)
	OnContainerLogChunk(func(*ContainerLogChunk) error)
	OnContainerError(func(ContainerError) error)
	OnStatus(func(PodStatus) error)

	GetStatus() PodStatus
	Track(name, namespace string, kube kubernetes.Interface, opts tracker.Options) error
}

func NewFeed

func NewFeed() Feed

type Options added in v0.6.2

type Options struct {
	IgnoreReadinessProbeFailsByContainerName map[string]time.Duration
}

type PodError

type PodError struct {
	ContainerError
	PodName string
}

type PodLogChunk

type PodLogChunk struct {
	*ContainerLogChunk
	PodName string
}

type PodStatus

type PodStatus struct {
	corev1.PodStatus

	Name string

	StatusGeneration uint64

	StatusIndicator *indicators.StringEqualConditionIndicator
	Age             string
	Restarts        int32
	ReadyContainers int32
	TotalContainers int32

	IsReady      bool
	IsFailed     bool
	IsSucceeded  bool
	FailedReason string

	ContainersErrors []ContainerError
}

func NewPodStatus

func NewPodStatus(pod *corev1.Pod, statusGeneration uint64, trackedContainers []string, isTrackerFailed bool, trackerFailedReason string) PodStatus

type PodsInformer

type PodsInformer struct {
	tracker.Tracker
	Controller utils.ControllerMetadata
	PodAdded   chan *corev1.Pod
	Errors     chan error
}

PodsInformer monitor pod add events to use with controllers (Deployment, StatefulSet, DaemonSet)

func NewPodsInformer

func NewPodsInformer(trk *tracker.Tracker, controller utils.ControllerMetadata) *PodsInformer

func (*PodsInformer) Run

func (p *PodsInformer) Run(ctx context.Context)

func (*PodsInformer) WithChannels

func (p *PodsInformer) WithChannels(added chan *corev1.Pod, errors chan error) *PodsInformer

type ReadinessProbe added in v0.6.2

type ReadinessProbe struct {
	corev1.Probe
	// contains filtered or unexported fields
}

func NewReadinessProbe added in v0.6.2

func NewReadinessProbe(readinessProbe, startupProbe *corev1.Probe, isStartedNow *bool, ignoreFailuresDurationOverride *time.Duration) ReadinessProbe

func (*ReadinessProbe) IsFailureShouldBeIgnoredNow added in v0.6.2

func (p *ReadinessProbe) IsFailureShouldBeIgnoredNow() bool

func (*ReadinessProbe) SetupStartedAtTime added in v0.6.2

func (p *ReadinessProbe) SetupStartedAtTime(isStartedNow *bool)

type Tracker

type Tracker struct {
	tracker.Tracker

	Added     chan PodStatus
	Deleted   chan PodStatus
	Succeeded chan PodStatus
	Ready     chan PodStatus
	Failed    chan FailedReport
	Status    chan PodStatus

	EventMsg          chan string
	ContainerLogChunk chan *ContainerLogChunk
	ContainerError    chan ContainerErrorReport

	// LastStatus struct is needed for the Job tracker.
	// LastStatus contains latest known and actual resource status.
	LastStatus PodStatus

	State                        tracker.TrackerState
	ContainerTrackerStates       map[string]tracker.TrackerState
	ContainerTrackerStateChanges map[string]chan tracker.TrackerState

	TrackedContainers []string
	LogsFromTime      time.Time
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(name, namespace string, kube kubernetes.Interface, opts Options) *Tracker

func (*Tracker) Start

func (pod *Tracker) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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