-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
types.go
24 lines (21 loc) · 1.16 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterResourceOverrideConfig is the configuration for the ClusterResourceOverride
// admission controller which overrides user-provided container request/limit values.
type ClusterResourceOverrideConfig struct {
metav1.TypeMeta `json:",inline"`
// For each of the following, if a non-zero ratio is specified then the initial
// value (if any) in the pod spec is overwritten according to the ratio.
// LimitRange defaults are merged prior to the override.
//
// LimitCPUToMemoryPercent (if > 0) overrides the CPU limit to a ratio of the memory limit;
// 100% overrides CPU to 1 core per 1GiB of RAM. This is done before overriding the CPU request.
LimitCPUToMemoryPercent int64 `json:"limitCPUToMemoryPercent"`
// CPURequestToLimitPercent (if > 0) overrides CPU request to a percentage of CPU limit
CPURequestToLimitPercent int64 `json:"cpuRequestToLimitPercent"`
// MemoryRequestToLimitPercent (if > 0) overrides memory request to a percentage of memory limit
MemoryRequestToLimitPercent int64 `json:"memoryRequestToLimitPercent"`
}