Help us shape the future of Go! Take the 2026 Go Developer Survey

workloads

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPodQoSClass

func GetPodQoSClass(pod *corev1.Pod) corev1.PodQOSClass

func LimitForRatio added in v0.14.0

func LimitForRatio(
	name corev1.ResourceName,
	request resource.Quantity,
	ratio resource.Quantity,
) (resource.Quantity, error)

LimitForRatio calculates request * ratio without floating-point arithmetic. The result is rounded down so it never exceeds the configured maximum ratio.

func PodFromTemplate added in v0.15.0

func PodFromTemplate(obj *unstructured.Unstructured) (*corev1.Pod, error)

PodFromTemplate decodes the Pod-spec projection used by existing validators. The controller object remains the admission/condition/event identity.

func PodLevelResourceSupported added in v0.14.0

func PodLevelResourceSupported(name corev1.ResourceName) bool

PodLevelResourceSupported reports whether Kubernetes permits the resource name in Pod-level resource requirements.

func PodTemplatePath added in v0.15.0

func PodTemplatePath(gvk schema.GroupVersionKind) []string

PodTemplatePath recognizes only the supported native controller groups.

func RatioSupportedResource added in v0.14.0

func RatioSupportedResource(name corev1.ResourceName) bool

RatioSupportedResource reports whether Capsule can safely calculate a limit-to-request ratio for the resource. CPU is rounded down to milliCPU; byte-based resources are rounded down to whole bytes.

Types

type PlacementAffinityTerm added in v0.15.0

type PlacementAffinityTerm struct {
	Type   rules.PlacementAffinityType
	Mode   rules.PlacementAffinityMode
	Weight int32
	Node   *corev1.NodeSelectorTerm
	Pod    *corev1.PodAffinityTerm
}

PlacementAffinityTerm retains term boundaries: constraints from different allow entries cannot accidentally be combined to permit an entire term.

type PlacementMatcher added in v0.15.0

type PlacementMatcher struct {
	Expressions runtime.ExpressionRegexMatcher
}

PlacementMatcher uses the process-local expression cache supplied by admission.

func (PlacementMatcher) Affinity added in v0.15.0

func (m PlacementMatcher) Affinity(rule rules.WorkloadAffinityMatch, value PlacementAffinityTerm, namespace string, podLabels map[string]string) (bool, error)

func (PlacementMatcher) LabelSelector added in v0.15.0

func (m PlacementMatcher) LabelSelector(rule *rules.PlacementLabelSelectorMatch, value *metav1.LabelSelector, matchKeys, mismatchKeys []string, podLabels map[string]string) (bool, error)

LabelSelector checks matchLabels, matchExpressions and dynamic keys together. It never mutates a selector that may belong to a cache or an admission object.

func (PlacementMatcher) NodeSelector added in v0.15.0

func (m PlacementMatcher) NodeSelector(rule rules.WorkloadNodeSelectorMatch, key, value string) (bool, error)

func (PlacementMatcher) Toleration added in v0.15.0

func (PlacementMatcher) TopologySpread added in v0.15.0

Jump to

Keyboard shortcuts

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