pdbreaper

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonCrashLoopBackOff = "CrashLoopBackOff"

	EventReasonPodDisruptionBudgetDeleted    = "PodDisruptionBudgetDeleted"
	EventReasonBlockingDetected              = "BlockingPodDisruptionBudget"
	EventReasonMultipleDetected              = "MultiplePodDisruptionBudgets"
	EventReasonBlockingCrashLoopDetected     = "BlockingPodDisruptionBudgetWithCrashLoop"
	EventReasonBlockingNotReadyStateDetected = "BlockingPodDisruptionBudgetWithNotReadyState"

	EventMessageDeletedFmt   = "The PodDisruptionBudget %v has been deleted by pdb-reaper due to violation"
	EventMessageBlockingFmt  = "The PodDisruptionBudget %v has been marked for deletion due to misconfiguration/not allowing disruptions"
	EventMessageMultipleFmt  = "The PodDisruptionBudget %v has been marked for deletion due to multiple budgets targeting same pods"
	EventMessageCrashLoopFmt = "The PodDisruptionBudget %v has been marked for deletion due to pods in CrashLoopBackOff blocking disruptions"
	EventMessageNotReadyFmt  = "The PodDisruptionBudget %v has been marked for deletion due to pods in not-ready blocking disruptions"

	PdbReaperResultMetricName = "governor_pdb_reaper_result"
)

Variables

Functions

func Run

func Run(args *Args) error

Run is the main runner function for pdb-reaper, and will initialize and start the pdb-reaper

Types

type Args

type Args struct {
	K8sConfigPath         string
	DryRun                bool
	LocalMode             bool
	ReapMisconfigured     bool
	ReapMultiple          bool
	ReapCrashLoop         bool
	AllCrashLoop          bool
	ExcludedNamespaces    []string
	CrashLoopRestartCount int
	ReapNotReady          bool
	ReapNotReadyThreshold int
	AllNotReady           bool
	PromPushgateway       string
}

Args is the argument struct for pdb-reaper

type ReaperContext

type ReaperContext struct {
	KubernetesClient                           kubernetes.Interface
	KubernetesConfigPath                       string
	DryRun                                     bool
	LocalMode                                  bool
	ReapMisconfigured                          bool
	ReapMultiple                               bool
	ReapCrashLoop                              bool
	AllCrashLoop                               bool
	CrashLoopRestartCount                      int
	ReapNotReady                               bool
	ReapNotReadyThreshold                      int
	AllNotReady                                bool
	ReapablePodDisruptionBudgets               []policyv1.PodDisruptionBudget
	ClusterBlockingPodDisruptionBudgets        map[string][]policyv1.PodDisruptionBudget
	NamespacesWithMultiplePodDisruptionBudgets map[string][]policyv1.PodDisruptionBudget
	ExcludedNamespaces                         []string
	ReapablePodDisruptionBudgetsCount          int
	ReapedPodDisruptionBudgetCount             int
	PromPushgateway                            string
	MetricsAPI                                 common.MetricsAPI
}

ReaperContext holds the context of the pdb-reaper and target cluster

func NewReaperContext

func NewReaperContext(args *Args) *ReaperContext

Jump to

Keyboard shortcuts

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