Documentation ¶
Index ¶
- Constants
- Variables
- func BytesSize(size float64) string
- func CustomSize(format string, size float64, base float64, _map []string) string
- func DefaultDeleteOptions() *metav1.DeleteOptions
- func DefaultLabelSelector() (selector labels.Selector)
- func FilterNodesWithPredicate(ss []*v1.Node, test func(*v1.Node) bool) (ret []*v1.Node)
- func FilterRunningPods(pods []*v1.Pod) []*v1.Pod
- func FilterWorkerNode() func(*v1.Node) bool
- func MapIntersects(a map[string]string, b map[string]string) bool
- func NodesCpuAllocatable(workerNodes []*v1.Node) (result int64)
- func NodesMemAllocatable(workerNodes []*v1.Node) (result int64)
- func PodsCpuRequest(pods []*v1.Pod) (result int64)
- func PodsMemRequest(pods []*v1.Pod) (result int64)
- func TotalRequestNS(pods []*v1.Pod) *v1.ResourceList
- type Config
- type ConfigurationManager
Constants ¶
View Source
const ( ControllerName = "kotary-controller" MessageRejectedMemory = "Not enough Memory claiming %s but %s currently available" MessageRejectedCPU = "Not enough CPU claiming %s but %s currently available" MessageMemoryAllocationLimit = "Exceeded Memory allocation limit claiming %s but limited to %s" MessageCpuAllocationLimit = "Exceeded CPU allocation limit claiming %s but limited to %s" MessagePendingMemoryDownscale = "Awaiting lower Memory consumption claiming %s but current total of request is %s" MessagePendingCpuDownscale = "Awaiting lower CPU consumption claiming %s but current total of CPU request is %s" ResourceQuotaName = "managed-quota" EmptyMsg = "" )
Variables ¶
View Source
var ClaimCounter = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "rq_operator_claims", Help: "Number of claims", }, []string{"status"})
View Source
var DefaultClaimCounter = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "rq_operator_default_claims", Help: "Number of default claims created", }, []string{"status"})
Functions ¶
func DefaultDeleteOptions ¶
func DefaultDeleteOptions() *metav1.DeleteOptions
func DefaultLabelSelector ¶
func FilterNodesWithPredicate ¶ added in v1.24.0
func FilterWorkerNode ¶
Predicate to filter out un-schedulable, role master labeled or not ready nodes
func MapIntersects ¶
Maps a and b have intersection
func NodesCpuAllocatable ¶
func NodesMemAllocatable ¶
func PodsCpuRequest ¶
func PodsMemRequest ¶
func TotalRequestNS ¶
func TotalRequestNS(pods []*v1.Pod) *v1.ResourceList
Types ¶
type Config ¶
type Config struct { // The spec of the default ResourceQuotaClaim to apply on Namespaces DefaultClaimSpec v1.ResourceList `yaml:"defaultClaimSpec"` // Maximum resource size that can be claimed compared to the total cluster size // 0.3 -> Max claim size will be a third of the cluster resources RatioMaxAllocationMemory float64 `yaml:"ratioMaxAllocationMemory"` RatioMaxAllocationCPU float64 `yaml:"ratioMaxAllocationCPU"` // Apply an over provisioning on the available resources of all the nodes // Represented as a percentage (could be under 100 to under provision) RatioOverCommitMemory float64 `yaml:"ratioOverCommitMemory"` RatioOverCommitCPU float64 `yaml:"ratioOverCommitCPU"` }
Hold the configurations specification
type ConfigurationManager ¶
type ConfigurationManager struct { Conf Config // contains filtered or unexported fields }
Hold the config and a clienset to retrieve it
func NewSettingManger ¶
func NewSettingManger(clientset kubernetes.Interface) *ConfigurationManager
Create a new instance
func (*ConfigurationManager) Load ¶
func (c *ConfigurationManager) Load()
Load configmap based on where the controller is running
Click to show internal directories.
Click to hide internal directories.