pod

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

	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