utils

package
v1.17.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// LingjunTaintKey is the taint key for Lingjun nodes
	LingjunTaintKey = "node-role.alibabacloud.com/lingjun"

	// LingjunWorkerLabelKey is the label key for Lingjun worker nodes
	LingjunWorkerLabelKey = "alibabacloud.com/lingjun-worker"

	// ExclusiveENILabelKey is the label key for exclusive ENI mode nodes
	ExclusiveENILabelKey = "k8s.aliyun.com/exclusive-mode-eni-type"

	// ExclusiveENILabelValue is the label value for exclusive ENI mode nodes
	ExclusiveENILabelValue = "eniOnly"
)

Variables

This section is empty.

Functions

func IsLingjunNodeType added in v1.16.5

func IsLingjunNodeType(nodeType string) bool

IsLingjunNodeType checks if the given node type string represents a Lingjun node

func LingjunToleration added in v1.16.5

func LingjunToleration() corev1.Toleration

LingjunToleration returns the toleration for Lingjun nodes

func LingjunTolerations added in v1.16.5

func LingjunTolerations() []corev1.Toleration

LingjunTolerations returns a slice containing the Lingjun toleration

func ParseAllocIPSucceedLatency added in v1.16.5

func ParseAllocIPSucceedLatency(message string) (time.Duration, error)

ParseAllocIPSucceedLatency parses the latency from AllocIPSucceed event message Example message: "Alloc IP 10.186.243.34/16-2001:db8:0000:0000:40ce:fc69:8c7:210a/64 took 37.358159ms"

Types

type Deployment added in v1.16.5

type Deployment struct {
	*appsv1.Deployment
}

Deployment is a builder for creating deployment configurations

func NewDeployment added in v1.16.5

func NewDeployment(name, namespace string, replicas int32) *Deployment

NewDeployment creates a new deployment builder

func (*Deployment) WithAnnotations added in v1.16.5

func (d *Deployment) WithAnnotations(annotations map[string]string) *Deployment

WithAnnotations adds annotations to the pod template

func (*Deployment) WithLabels added in v1.16.5

func (d *Deployment) WithLabels(labels map[string]string) *Deployment

WithLabels adds labels to the pod template

func (*Deployment) WithLingjunToleration added in v1.16.5

func (d *Deployment) WithLingjunToleration() *Deployment

WithLingjunToleration adds toleration for Lingjun nodes

func (*Deployment) WithNodeAffinity added in v1.16.5

func (d *Deployment) WithNodeAffinity(labels map[string]string) *Deployment

WithNodeAffinity adds node affinity to the deployment

func (*Deployment) WithNodeAffinityExclude added in v1.16.5

func (d *Deployment) WithNodeAffinityExclude(excludeLabels map[string]string) *Deployment

WithNodeAffinityExclude adds node affinity exclusion to the deployment

func (*Deployment) WithPodAffinity added in v1.16.5

func (d *Deployment) WithPodAffinity(labels map[string]string) *Deployment

WithPodAffinity adds pod affinity to schedule pods to the same node as pods with specified labels

func (*Deployment) WithTolerations added in v1.16.5

func (d *Deployment) WithTolerations(tolerations []corev1.Toleration) *Deployment

WithTolerations adds tolerations to the deployment

type LatencyStats added in v1.16.5

type LatencyStats struct {
	P99 time.Duration
	P90 time.Duration
	Max time.Duration
	Min time.Duration
	Avg time.Duration
	N   int
}

LatencyStats contains latency statistics

func CalculateLatencyStats added in v1.16.5

func CalculateLatencyStats(latencies []time.Duration) LatencyStats

CalculateLatencyStats calculates latency statistics from a slice of durations

func (LatencyStats) String added in v1.16.5

func (s LatencyStats) String() string

String returns a formatted string of latency stats

Jump to

Keyboard shortcuts

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