zpdb

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodEvictionWebhookPath = "/admission/pod-eviction"

	ZoneAwarePodDisruptionBudgetName        = "ZoneAwarePodDisruptionBudget"
	ZoneAwarePodDisruptionBudgetsNamePlural = "zoneawarepoddisruptionbudgets"
	ZoneAwarePodDisruptionBudgetsSpecGroup  = "rollout-operator.grafana.com"
	ZoneAwarePodDisruptionBudgetsVersion    = "v1"

	// attributes in the zpdb yaml file
	FieldMaxUnavailable           = "maxUnavailable"
	FieldMaxUnavailablePercentage = "maxUnavailablePercentage"
	FieldPodNamePartitionRegex    = "podNamePartitionRegex"
	FieldPodNameRegexGroup        = "podNameRegexGroup"
	FieldCrossZoneEvictionDelay   = "crossZoneEvictionDelay"
	FieldSelector                 = "selector"
	FieldMatchLabels              = "matchLabels"
)

Variables

This section is empty.

Functions

func ParseAndValidate

func ParseAndValidate(obj *unstructured.Unstructured) (*config, error)

ParseAndValidate attempts to parse the given Unstructured to a Config. An error is returned if any configuration errors are found.

Types

type EvictionController

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

func NewEvictionController

func NewEvictionController(kubeClient kubernetes.Interface, dynamicClient dynamic.Interface, namespace string, podsFactory informers.SharedInformerFactory, logger log.Logger, metrics *Metrics) *EvictionController

func (*EvictionController) AllowMissingCRDs added in v0.42.0

func (c *EvictionController) AllowMissingCRDs()

AllowMissingCRDs permits bootstrap before ZPDB protection is installed. Call before Start.

func (*EvictionController) HandlePodEvictionRequest

func (c *EvictionController) HandlePodEvictionRequest(ctx context.Context, ar v1.AdmissionReview, maxUnavailableOverride MaxUnavailableZeroOverride) *v1.AdmissionResponse

func (*EvictionController) HasPartitionAwarePdb added in v0.33.0

func (c *EvictionController) HasPartitionAwarePdb(pod *corev1.Pod) (bool, error)

func (*EvictionController) MarkPodAsDeleted added in v0.32.0

func (c *EvictionController) MarkPodAsDeleted(ctx context.Context, namespace string, podName string, source string, override MaxUnavailableZeroOverride) error

MarkPodAsDeleted allows for a programmatic pod eviction request. It returns an error if the pod eviction is denied. Note that if this func returns without an error, the pod will be marked as pending eviction within the zpdb eviction cache. Note also that this func does not actually evict or delete the pod from kubernetes.

func (*EvictionController) Start

func (c *EvictionController) Start() error

func (*EvictionController) Stop

func (c *EvictionController) Stop()

type MaxUnavailableZeroOverride added in v0.33.0

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

MaxUnavailableZeroOverride provides an alternate maxUnavailable value to be used when the current maxUnavailable configuration is set to zero.

func NewMaxUnavailableZeroOverride added in v0.33.0

func NewMaxUnavailableZeroOverride(maxUnavailable int) MaxUnavailableZeroOverride

func NewMaxUnavailableZeroOverrideNone added in v0.33.0

func NewMaxUnavailableZeroOverrideNone() MaxUnavailableZeroOverride

type Metrics added in v0.32.1

type Metrics struct {
	ConfigurationsObserved *prometheus.CounterVec
	EvictionRequests       *prometheus.CounterVec
	InFlightRequests       *prometheus.GaugeVec
	ConfigObserverReady    *prometheus.GaugeVec
}

func NewMetrics added in v0.32.1

func NewMetrics(reg prometheus.Registerer) *Metrics

Jump to

Keyboard shortcuts

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