orchestrator

package
Version: v0.0.0-...-dc6f603 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: 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 ChunkRange

func ChunkRange(numberOfElements, chunkCount, chunkSize, counter int) (int, int)

ChunkRange returns the chunk start and end for an iteration.

func GroupSize

func GroupSize(msgs, maxPerMessage int) int

GroupSize returns the GroupSize/number of chunks.

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
	// K8sJob represents a Kubernetes Job
	K8sJob
	// K8sCronJob represents a Kubernetes CronJob
	K8sCronJob
	// K8sDaemonSet represents a Kubernetes DaemonSet
	K8sDaemonSet
	// K8sStatefulSet represents a Kubernetes StatefulSet
	K8sStatefulSet
	// K8sPersistentVolume represents a Kubernetes PersistentVolume
	K8sPersistentVolume
	// K8sPersistentVolumeClaim represents a Kubernetes PersistentVolumeClaim
	K8sPersistentVolumeClaim
	// K8sRole represents a Kubernetes Role
	K8sRole
	// K8sRoleBinding represents a Kubernetes RoleBinding
	K8sRoleBinding
	// K8sClusterRole represents a Kubernetes ClusterRole
	K8sClusterRole
	// K8sClusterRoleBinding represents a Kubernetes ClusterRoleBinding
	K8sClusterRoleBinding
	// K8sServiceAccount represents a Kubernetes ServiceAccount
	K8sServiceAccount
)

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