kubernetes

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ResmgrKeyNamespace is a NRI Resource Policy namespace
	ResmgrKeyNamespace = "resource-policy.nri.io"

	// NamespaceSystem is the kubernetes system namespace.
	NamespaceSystem = "kube-system"
	// PodNameLabel is the key for the kubernetes pod name label.
	PodNameLabel = "io.kubernetes.pod.name"
	// ContainerNameLabel is the key for the kubernetes container name label.
	ContainerNameLabel = "io.kubernetes.container.name"
)
View Source
const (

	// MinShares is the minimum cpu.shares accepted by cgroups.
	MinShares = 2
	// MaxShares is the minimum cpu.shares accepted by cgroups.
	MaxShares = 262144
	// SharesPerCPU is cpu.shares worth one full CPU.
	SharesPerCPU = 1024
	// MilliCPUToCPU is milli-CPUs worth a full CPU.
	MilliCPUToCPU = 1000
	// QuotaPeriod is 100000 microseconds, or 100ms
	QuotaPeriod = 100000
	// MinQuotaPeriod is 1000 microseconds, or 1ms
	MinQuotaPeriod = 1000
)

Variables

This section is empty.

Functions

func MilliCPUToQuota

func MilliCPUToQuota(milliCPU int64) (quota, period int64)

MilliCPUToQuota converts milliCPU to CFS quota and period values. (Almost) identical to the same function in kubelet.

func MilliCPUToShares

func MilliCPUToShares(milliCPU int64) uint64

MilliCPUToShares converts the milliCPU to CFS shares. Identical to the same function in kubelet.

func QuotaToMilliCPU

func QuotaToMilliCPU(quota, period int64) int64

QuotaToMilliCPU converts CFS quota and period to milli-CPUs.

func ResmgrKey

func ResmgrKey(name string) string

ResmgrKey returns a full namespaced name of a resource manager specific key

func SharesToMilliCPU

func SharesToMilliCPU(shares int64) int64

SharesToMilliCPU converts CFS CPU shares to milli-CPUs.

func ShortCPUSet

func ShortCPUSet(cset cpuset.CPUSet) string

ShortCPUSet prints the cpuset as a string, trying to further shorten compared to .String().

Types

This section is empty.

Jump to

Keyboard shortcuts

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