resourcequota

package
v1.24.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultResourceQuotaName = "default"
	DefaultLimitRangeName    = "default"
)

Variables

View Source
var (
	ResourceDeployments            corev1.ResourceName = "count/deployments.apps"
	ResourceStatefulSets           corev1.ResourceName = "count/statefulsets.apps"
	ResourceJobs                   corev1.ResourceName = "count/jobs.batch"
	ResourceCronJobs               corev1.ResourceName = "count/cronjobs.batch"
	ResourceSecrets                corev1.ResourceName = "count/secrets"
	ResourceConfigMaps             corev1.ResourceName = "count/configmaps"
	ResourceServices               corev1.ResourceName = "count/services"
	ResourcePersistentVolumeClaims corev1.ResourceName = "count/persistentvolumeclaims"
	ResourceDaemonsets             corev1.ResourceName = "count/daemonsets.apps"
	ResourceIngresses              corev1.ResourceName = "count/ingresses.extensions"
)

Functions

func GetDefaultEnvironmentLimitRange

func GetDefaultEnvironmentLimitRange() []corev1.LimitRangeItem

GetDefaultEnvironmentLimitRange 环境默认的limitranger

func GetDefaultEnvironmentResourceQuota

func GetDefaultEnvironmentResourceQuota() corev1.ResourceList

GetDefaultEnvironmentResourceQuota 环境的默认资源限制

func GetDefaultTeantResourceQuota

func GetDefaultTeantResourceQuota() corev1.ResourceList

GetDefaultTeantResourceQuota 获取默认的ResourceQuota

func IsLimitRangeInvalid

func IsLimitRangeInvalid(limitRangeItems []corev1.LimitRangeItem) ([]string, bool)

func ResourceEnough

func ResourceEnough(total, used, need corev1.ResourceList) (bool, []string)

ResourceEnough 资源 是否足够,不够给出不够的错误项

func ResourceIsEnough

func ResourceIsEnough(total, used, need corev1.ResourceList, resources []corev1.ResourceName) (bool, []string)

func SetSameRequestWithLimit added in v1.22.0

func SetSameRequestWithLimit(list corev1.ResourceList)

set request same as limit if not set

func SubResource

func SubResource(oldres, newres corev1.ResourceList) corev1.ResourceList

SubResource 用新的值去减去旧的,得到差

Types

This section is empty.

Jump to

Keyboard shortcuts

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