kubernetes

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 0 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// ResmgrKeyNamespace is a CRI Resource Manager namespace
	ResmgrKeyNamespace = "cri-resource-manager.intel.com"

	// NamespaceSystem is the kubernetes system namespace.
	NamespaceSystem = "kube-system"
	// PodNameLabel is the key for the kubernetes pod name label.
	PodNameLabel = "io.kubernetes.pod.name"
	// PodNameLabel is the key for the kubernetes pod UID label.
	PodUIDLabel = "io.kubernetes.pod.uid"
	// 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 added in v0.8.4

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 added in v0.8.4

func MilliCPUToShares(milliCPU int64) uint64

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

func QuotaToMilliCPU added in v0.8.4

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 added in v0.8.4

func SharesToMilliCPU(shares int64) int64

SharesToMilliCPU converts CFS CPU shares to milli-CPUs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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