Documentation ¶
Index ¶
- Constants
- Variables
- func GetDefaultEnvironmentLimitRange() []corev1.LimitRangeItem
- func GetDefaultEnvironmentResourceQuota() corev1.ResourceList
- func GetDefaultTeantResourceQuota() corev1.ResourceList
- func IsLimitRangeInvalid(limitRangeItems []corev1.LimitRangeItem) ([]string, bool)
- func ResourceEnough(total, used, need corev1.ResourceList) (bool, []string)
- func ResourceIsEnough(total, used, need corev1.ResourceList, resources []corev1.ResourceName) (bool, []string)
- func SetSameRequestWithLimit(list corev1.ResourceList)
- func SubResource(oldres, newres corev1.ResourceList) corev1.ResourceList
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.
Click to show internal directories.
Click to hide internal directories.