Documentation ¶
Index ¶
- Constants
- type CPU
- type ContainerStats
- type Memory
- type Probe
- type Reconciler
- func (r *Reconciler) Adjust(containerName string, memFactor, cpuFactor float64) error
- func (r *Reconciler) InitCStats(pod *corev1.Pod)
- func (r *Reconciler) KondenseCPU(container corev1.Container) float64
- func (r *Reconciler) KondenseContainer(container corev1.Container) error
- func (r *Reconciler) KondenseMemory(container corev1.Container) float64
- func (r *Reconciler) Reconcile()
- func (r *Reconciler) ReconcileContainer(pod *corev1.Pod, container corev1.Container, wg *sync.WaitGroup)
- func (r *Reconciler) UpdateCPUStats(containerName string, txt []string) error
- func (r *Reconciler) UpdateMemStats(containerName string, txt []string) error
- func (r *Reconciler) UpdateStats(pod *corev1.Pod, container corev1.Container) error
- type Stats
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPU ¶
type CPU struct { // Limit is the cpu limit of the container in millicpus. Limit int64 // Min is the minimum cpu limit allowed on the container in millicpus. Min uint64 // Max is the maximum cpu limit allowed on the container in millicpus. Max uint64 // TargetAvg is the target cpu usage of the container. It is from 0 to 1. e.g. 0.8 means a target cpu usage of 80%. TargetAvg float64 // MaxInc is the max cpu increase in percent allowed. For example 0.5 means kondense can increase the cpu limit up to 50%. MaxInc float64 // MaxDec is the max cpu decrease in percent allowed. For example 0.5 means kondense can decrease the cpu limit up to 50%. MaxDec float64 // Coeff is used to calculate the new cpu limit when a cpu increase is needed. The higher the coeff, the higher the new cpu limit. Coeff uint64 // Interval is the interval in seconds used to calculate the cpu average usage. Interval uint64 // Probes is a queue to store total cpu usage at a specific time. Probes []Probe // Avg is the cpu average usage in millicpus. Avg uint64 }
type ContainerStats ¶
type Memory ¶
type Memory struct { // Limit is the memory limit in bytes of the container. Limit int64 // Min is the minimum memory limit in bytes allowed on the container. Min uint64 // Max is the maximum memory limit in bytes allowed on the container. Max uint64 // PrevTotal is the previous total of memory used in bytes on the container. PrevTotal uint64 // Integral is the sum of memory used every second. // It is put back to 0 when Interval of time passed or when the memory is patched. Integral uint64 // Target presssure is the target memory pressure in microseconds of the container. TargetPressure uint64 // MaxInc is the max memory increase in percent allowed. For example 0.5 means kondense can increase the memory limit up to 50%. MaxInc float64 // MaxDec is the max memory decrease in percent allowed. For example 0.5 means kondense can decrease the memory limit up to 50%. MaxDec float64 // CoeffInc defines how sensitive we are to fluctuations around the target pressure when pressure is higher than target pressure. // e.g. when CoeffInc is 10, the curve reaches MaxInc when pressure is 10 times the target pressure. CoeffInc float64 // CoeffDec defines how sensitive we are to fluctuations around the target pressure when pressure is lower than target pressure. // e.g. when CoeffDec is 10, the curve reaches MaxDec when pressure is 1/10 times the target pressure. CoeffDec float64 // Interval is the number of seconds to calculate the target memory pressure. // e.g. when Interval is 7, it means that ideally the target memory pressure should be obtained after 7 seconds. Interval uint64 // GraceTicks is the number of seconds passed since Interval went to 0 for the last time. GraceTicks uint64 }
type Reconciler ¶
type Reconciler struct { Client *kubernetes.Clientset RawClient *http.Client Mu sync.Mutex BearerToken string Namespace string Name string CStats ContainerStats }
func (*Reconciler) Adjust ¶
func (r *Reconciler) Adjust(containerName string, memFactor, cpuFactor float64) error
func (*Reconciler) InitCStats ¶
func (r *Reconciler) InitCStats(pod *corev1.Pod)
func (*Reconciler) KondenseCPU ¶
func (r *Reconciler) KondenseCPU(container corev1.Container) float64
func (*Reconciler) KondenseContainer ¶
func (r *Reconciler) KondenseContainer(container corev1.Container) error
func (*Reconciler) KondenseMemory ¶
func (r *Reconciler) KondenseMemory(container corev1.Container) float64
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile()
func (*Reconciler) ReconcileContainer ¶
func (*Reconciler) UpdateCPUStats ¶
func (r *Reconciler) UpdateCPUStats(containerName string, txt []string) error
func (*Reconciler) UpdateMemStats ¶
func (r *Reconciler) UpdateMemStats(containerName string, txt []string) error
func (*Reconciler) UpdateStats ¶
Click to show internal directories.
Click to hide internal directories.