resource_evaluator

package module
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

resource-evaluator

kubernetes resource-evaluator

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsPrefix

func ContainsPrefix(prefixSet []string, item v1.ResourceName) bool

ContainsPrefix returns true if the specified item has a prefix that contained in given prefix Set

func GetPersistentVolumeClaimClass added in v1.17.2

func GetPersistentVolumeClaimClass(claim *v1.PersistentVolumeClaim) string

GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was requested, it returns "".

func IsExtendedResourceName

func IsExtendedResourceName(name v1.ResourceName) bool

IsExtendedResourceName returns true if: 1. the resource name is not in the default namespace; 2. resource name does not have "requests." prefix, to avoid confusion with the convention in quota 3. it satisfies the rules in IsQualifiedName() after converted into quota resource name

func IsNativeResource

func IsNativeResource(name v1.ResourceName) bool

IsNativeResource returns true if the resource name is in the *kubernetes.io/ namespace. Partially-qualified (unprefixed) names are implicitly in the kubernetes.io/ namespace.

func IsPrefixedNativeResource

func IsPrefixedNativeResource(name v1.ResourceName) bool

IsPrefixedNativeResource returns true if the resource name is in the *kubernetes.io/ namespace.

func Max

Max returns the result of Max(a, b) for each named resource

func ObjectCountQuotaResourceNameFor

func ObjectCountQuotaResourceNameFor(groupResource schema.GroupResource) v1.ResourceName

ObjectCountQuotaResourceNameFor returns the object count quota name for specified groupResource

func PVCUsage added in v1.17.2

func PVCUsage(item runtime.Object) (v1.ResourceList, error)

func PodUsageFunc

func PodUsageFunc(obj runtime.Object, clock clock.Clock) (v1.ResourceList, error)

PodUsageFunc returns the quota usage for a pod. A pod is charged for quota if the following are not true.

  • pod has a terminal phase (failed or succeeded)
  • pod has been marked for deletion and grace period has expired

func QuotaV1Pod

func QuotaV1Pod(pod *v1.Pod, clock clock.Clock) bool

QuotaV1Pod returns true if the pod is eligible to track against a quota if it's not in a terminal state according to its phase.

func ServiceUsage

func ServiceUsage(item runtime.Object) (v1.ResourceList, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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