cmd

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaintSoft = `node-drainer.rebuy-de.github.io/soft-shutdown`
	TaintHard = `node-drainer.rebuy-de.github.io/hard-shutdown`
)

Variables

This section is empty.

Functions

func InitIntrumentation

func InitIntrumentation(ctx context.Context) context.Context

func InstMainLoopCompletingInstance

func InstMainLoopCompletingInstance(ctx context.Context, instance collectors.Instance)

func InstMainLoopCordoningInstance

func InstMainLoopCordoningInstance(ctx context.Context, instance collectors.Instance)

func InstMainLoopDeletingLifecycleMessage

func InstMainLoopDeletingLifecycleMessage(ctx context.Context, instance collectors.Instance)

func InstMainLoopDeletingLifecycleMessageAgeSanityCheckFailed

func InstMainLoopDeletingLifecycleMessageAgeSanityCheckFailed(ctx context.Context, instance collectors.Instance, age time.Duration)

func InstMainLoopEvictPod

func InstMainLoopEvictPod(ctx context.Context, pod collectors.Pod)

func InstMainLoopNoop

func InstMainLoopNoop(ctx context.Context)

func InstMainLoopStarted

func InstMainLoopStarted(ctx context.Context, instances collectors.Instances, pods collectors.Pods)

func InstancesReadyForEviction

func InstancesReadyForEviction() collectors.InstanceSelector

func InstancesThanNeedLifecycleDeletion

func InstancesThanNeedLifecycleDeletion() collectors.InstanceSelector

func InstancesThatNeedCordon

func InstancesThatNeedCordon() collectors.InstanceSelector

func InstancesThatNeedLifecycleCompletion

func InstancesThatNeedLifecycleCompletion() collectors.InstanceSelector

func InstancesThatWantShutdown

func InstancesThatWantShutdown() collectors.InstanceSelector

func NewRootCommand

func NewRootCommand() *cobra.Command

func PodsReadyForEviction

func PodsReadyForEviction() collectors.PodSelector

func PodsThatWantEviction

func PodsThatWantEviction() collectors.PodSelector

func PodsUnreadyForEviction

func PodsUnreadyForEviction() collectors.PodSelector

func SortInstances

func SortInstances(instances collectors.Instances)

func SortPods

func SortPods(pods collectors.Pods)

Types

type HealthHandler

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

HealthHandler is a http.Handler that is used for the lifeness probe.

func (HealthHandler) ServeHTTP

func (h HealthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP reponds 200, when all services are healhy. Otherwise it responds with 503.

type Healthier

type Healthier interface {
	Healthy() bool
}

Healthier is a simple interface, that can easily be implemented by all critical services. It is used to indicate their health statuses.

type MainLoop

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

MainLoop does the actual node-drainer actions. When any client cache changes, it starts a new update loop and checks whether an action is required.

func NewMainLoop

func NewMainLoop(collectors collectors.Collectors) *MainLoop

NewMainLoop initializes a MainLoop.

func (*MainLoop) Healthy

func (l *MainLoop) Healthy() bool

Healthy indicates whether the background job is running correctly.

func (*MainLoop) Run

func (l *MainLoop) Run(ctx context.Context) error

Run starts the mainloop.

type Runner

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

func (*Runner) Bind

func (r *Runner) Bind(cmd *cobra.Command) error

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, cmd *cobra.Command, args []string)

type Server

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

Server is the HTTP server, which is used for the status page, metrics and healthyness.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the actual HTTP server.

Jump to

Keyboard shortcuts

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