orchestrator

package
v0.0.2-0...-4ce78c8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NoExpiration maps to go-cache corresponding value
	NoExpiration = cache.NoExpiration

	// ClusterAgeCacheKey is the key name for the orchestrator cluster age in the agent in-mem cache
	ClusterAgeCacheKey = "orchestratorClusterAge"
)

Variables

View Source
var (

	// KubernetesResourceCache provides an in-memory key:value store similar to memcached for kubernetes resources.
	KubernetesResourceCache = cache.New(defaultExpire, defaultPurge)
)

Functions

func BuildStatsKey

func BuildStatsKey(nodeType NodeType) string

BuildStatsKey builds a orchestrator statsKey prefixed key.

func SkipKubernetesResource

func SkipKubernetesResource(uid types.UID, resourceVersion string, nodeType NodeType) bool

SkipKubernetesResource checks with a global kubernetes cache whether the resource was already reported. It will return true in case the UID is in the cache and the resourceVersion did not change. Else it will return false. 0 == defaultDuration

Types

type CheckStats

type CheckStats struct {
	// CacheHits contains the number of cache hits for a NodeType per run.
	CacheHits int

	// CacheMiss contains the number of cache miss/send Data for a NodeType per run.
	CacheMiss int

	NodeType
}

CheckStats holds statistics for the DCA status command regarding the last run check. Information is saved in the KubernetesResourceCache.

type NodeType

type NodeType int

NodeType represents a kind of resource used by a container orchestrator.

const (
	// K8sDeployment represents a Kubernetes Deployment
	K8sDeployment NodeType = iota
	// K8sPod represents a Kubernetes Pod
	K8sPod
	// K8sReplicaSet represents a Kubernetes ReplicaSet
	K8sReplicaSet
	// K8sService represents a Kubernetes Service
	K8sService
	// K8sNode represents a Kubernetes Node
	K8sNode
	// K8sCluster represents a Kubernetes Cluster
	K8sCluster
)

func NodeTypes

func NodeTypes() []NodeType

NodeTypes returns the current existing NodesTypes as a slice to iterate over.

func (NodeType) Orchestrator

func (n NodeType) Orchestrator() string

Orchestrator returns the orchestrator name for a node type.

func (NodeType) String

func (n NodeType) String() string

func (NodeType) TelemetryTags

func (n NodeType) TelemetryTags() []string

TelemetryTags return tags used for telemetry.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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