Documentation
¶
Index ¶
- func GetControllerOf(pod *Pod) *metav1.OwnerReference
- func GetControllerOfNoCopy(pod *Pod) *metav1.OwnerReference
- type CachingWatchController
- func (c *CachingWatchController) GetAll() []interface{}
- func (c *CachingWatchController) Run(threadiness int, stopCh chan struct{})
- func (c *CachingWatchController) SetRemovedHandler(handler WatchHandler) WatchController
- func (c *CachingWatchController) SetUpdateHandler(handler WatchHandler) WatchController
- func (c *CachingWatchController) WarmUp(cancelCh chan struct{})
- type ClusterCache
- type ClusterExporter
- type ClusterImporter
- func (ci *ClusterImporter) GetAllDaemonSets() []*DaemonSet
- func (ci *ClusterImporter) GetAllDeployments() []*Deployment
- func (ci *ClusterImporter) GetAllJobs() []*Job
- func (ci *ClusterImporter) GetAllNamespaces() []*Namespace
- func (ci *ClusterImporter) GetAllNodes() []*Node
- func (ci *ClusterImporter) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
- func (ci *ClusterImporter) GetAllPersistentVolumes() []*PersistentVolume
- func (ci *ClusterImporter) GetAllPodDisruptionBudgets() []*PodDisruptionBudget
- func (ci *ClusterImporter) GetAllPods() []*Pod
- func (ci *ClusterImporter) GetAllReplicaSets() []*ReplicaSet
- func (ci *ClusterImporter) GetAllReplicationControllers() []*ReplicationController
- func (ci *ClusterImporter) GetAllServices() []*Service
- func (ci *ClusterImporter) GetAllStatefulSets() []*StatefulSet
- func (ci *ClusterImporter) GetAllStorageClasses() []*StorageClass
- func (ci *ClusterImporter) Run()
- func (ci *ClusterImporter) Stop()
- type Container
- type DaemonSet
- type Deployment
- type GenericStore
- func (s *GenericStore[Input, Output]) Add(obj any) error
- func (s *GenericStore[Input, Output]) Delete(obj any) error
- func (s *GenericStore[Input, Output]) Get(_ interface{}) (item interface{}, exists bool, err error)
- func (s *GenericStore[Input, Output]) GetAll() []Output
- func (s *GenericStore[Input, Output]) GetByKey(_ string) (item interface{}, exists bool, err error)
- func (s *GenericStore[Input, Output]) List() []interface{}
- func (s *GenericStore[Input, Output]) ListKeys() []string
- func (s *GenericStore[Input, Output]) Replace(list []any, _ string) error
- func (s *GenericStore[Input, Output]) Resync() error
- func (s *GenericStore[Input, Output]) Update(obj any) error
- func (s *GenericStore[Input, Output]) Watch(stopCh <-chan struct{}, onInit func())
- type Job
- type KubernetesClusterCache
- func (kcc *KubernetesClusterCache) GetAllDaemonSets() []*DaemonSet
- func (kcc *KubernetesClusterCache) GetAllDeployments() []*Deployment
- func (kcc *KubernetesClusterCache) GetAllJobs() []*Job
- func (kcc *KubernetesClusterCache) GetAllNamespaces() []*Namespace
- func (kcc *KubernetesClusterCache) GetAllNodes() []*Node
- func (kcc *KubernetesClusterCache) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
- func (kcc *KubernetesClusterCache) GetAllPersistentVolumes() []*PersistentVolume
- func (kcc *KubernetesClusterCache) GetAllPodDisruptionBudgets() []*PodDisruptionBudget
- func (kcc *KubernetesClusterCache) GetAllPods() []*Pod
- func (kcc *KubernetesClusterCache) GetAllReplicaSets() []*ReplicaSet
- func (kcc *KubernetesClusterCache) GetAllReplicationControllers() []*ReplicationController
- func (kcc *KubernetesClusterCache) GetAllServices() []*Service
- func (kcc *KubernetesClusterCache) GetAllStatefulSets() []*StatefulSet
- func (kcc *KubernetesClusterCache) GetAllStorageClasses() []*StorageClass
- func (kcc *KubernetesClusterCache) Run()
- func (kcc *KubernetesClusterCache) Stop()
- type KubernetesClusterCacheV2
- func (kcc *KubernetesClusterCacheV2) GetAllDaemonSets() []*DaemonSet
- func (kcc *KubernetesClusterCacheV2) GetAllDeployments() []*Deployment
- func (kcc *KubernetesClusterCacheV2) GetAllJobs() []*Job
- func (kcc *KubernetesClusterCacheV2) GetAllNamespaces() []*Namespace
- func (kcc *KubernetesClusterCacheV2) GetAllNodes() []*Node
- func (kcc *KubernetesClusterCacheV2) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
- func (kcc *KubernetesClusterCacheV2) GetAllPersistentVolumes() []*PersistentVolume
- func (kcc *KubernetesClusterCacheV2) GetAllPodDisruptionBudgets() []*PodDisruptionBudget
- func (kcc *KubernetesClusterCacheV2) GetAllPods() []*Pod
- func (kcc *KubernetesClusterCacheV2) GetAllReplicaSets() []*ReplicaSet
- func (kcc *KubernetesClusterCacheV2) GetAllReplicationControllers() []*ReplicationController
- func (kcc *KubernetesClusterCacheV2) GetAllServices() []*Service
- func (kcc *KubernetesClusterCacheV2) GetAllStatefulSets() []*StatefulSet
- func (kcc *KubernetesClusterCacheV2) GetAllStorageClasses() []*StorageClass
- func (kcc *KubernetesClusterCacheV2) Run()
- func (kcc *KubernetesClusterCacheV2) Stop()
- type Namespace
- type Node
- type PersistentVolume
- type PersistentVolumeClaim
- type Pod
- type PodDisruptionBudget
- type PodSpec
- type PodStatus
- type ReplicaSet
- type ReplicationController
- type Service
- type StatefulSet
- type StorageClass
- type UIDGetter
- type Volume
- type WatchController
- type WatchHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetControllerOf ¶ added in v1.114.0
func GetControllerOf(pod *Pod) *metav1.OwnerReference
GetControllerOf returns a pointer to a copy of the controllerRef if controllee has a controller
func GetControllerOfNoCopy ¶ added in v1.114.0
func GetControllerOfNoCopy(pod *Pod) *metav1.OwnerReference
GetControllerOfNoCopy returns a pointer to the controllerRef if controllee has a controller
Types ¶
type CachingWatchController ¶
type CachingWatchController struct {
// contains filtered or unexported fields
}
CachingWatchController composites the watching behavior and a cache to ensure that all up to date resources are readily available
func (*CachingWatchController) GetAll ¶
func (c *CachingWatchController) GetAll() []interface{}
func (*CachingWatchController) Run ¶
func (c *CachingWatchController) Run(threadiness int, stopCh chan struct{})
func (*CachingWatchController) SetRemovedHandler ¶
func (c *CachingWatchController) SetRemovedHandler(handler WatchHandler) WatchController
func (*CachingWatchController) SetUpdateHandler ¶
func (c *CachingWatchController) SetUpdateHandler(handler WatchHandler) WatchController
func (*CachingWatchController) WarmUp ¶
func (c *CachingWatchController) WarmUp(cancelCh chan struct{})
type ClusterCache ¶
type ClusterCache interface {
// Run starts the watcher processes
Run()
// Stops the watcher processes
Stop()
// GetAllNamespaces returns all the cached namespaces
GetAllNamespaces() []*Namespace
// GetAllNodes returns all the cached nodes
GetAllNodes() []*Node
// GetAllPods returns all the cached pods
GetAllPods() []*Pod
// GetAllServices returns all the cached services
GetAllServices() []*Service
// GetAllDaemonSets returns all the cached DaemonSets
GetAllDaemonSets() []*DaemonSet
// GetAllDeployments returns all the cached deployments
GetAllDeployments() []*Deployment
// GetAllStatfulSets returns all the cached StatefulSets
GetAllStatefulSets() []*StatefulSet
// GetAllReplicaSets returns all the cached ReplicaSets
GetAllReplicaSets() []*ReplicaSet
// GetAllPersistentVolumes returns all the cached persistent volumes
GetAllPersistentVolumes() []*PersistentVolume
// GetAllPersistentVolumeClaims returns all the cached persistent volume claims
GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
// GetAllStorageClasses returns all the cached storage classes
GetAllStorageClasses() []*StorageClass
// GetAllJobs returns all the cached jobs
GetAllJobs() []*Job
// GetAllPodDisruptionBudgets returns all cached pod disruption budgets
GetAllPodDisruptionBudgets() []*PodDisruptionBudget
// GetAllReplicationControllers returns all cached replication controllers
GetAllReplicationControllers() []*ReplicationController
}
ClusterCache defines an contract for an object which caches components within a cluster, ensuring up to date resources using watchers
func NewClusterImporter ¶
func NewClusterImporter(source *config.ConfigFile) ClusterCache
Creates a new ClusterCache implementation which uses an import process to provide cluster data
func NewKubernetesClusterCache ¶
func NewKubernetesClusterCache(client kubernetes.Interface) ClusterCache
func NewKubernetesClusterCacheV1 ¶ added in v1.114.0
func NewKubernetesClusterCacheV1(client kubernetes.Interface) ClusterCache
type ClusterExporter ¶
type ClusterExporter struct {
// contains filtered or unexported fields
}
ClusterExporter manages and runs an file export process which dumps the local kubernetes cluster to a target location.
func NewClusterExporter ¶
func NewClusterExporter(cluster ClusterCache, target *config.ConfigFile, interval time.Duration) *ClusterExporter
NewClusterExporter creates a new ClusterExporter instance for exporting the kubernetes cluster.
func (*ClusterExporter) Export ¶
func (ce *ClusterExporter) Export() error
Export stores the cluster cache data into a PODO, marshals as JSON, and saves it to the target location.
func (*ClusterExporter) Run ¶
func (ce *ClusterExporter) Run()
Run starts the automated process of running Export on a specific interval.
func (*ClusterExporter) Stop ¶
func (ce *ClusterExporter) Stop()
Stop halts the Cluster export on an interval
type ClusterImporter ¶
type ClusterImporter struct {
// contains filtered or unexported fields
}
ClusterImporter is an implementation of ClusterCache which leverages a backing configuration file as it's source of the cluster data.
func (*ClusterImporter) GetAllDaemonSets ¶
func (ci *ClusterImporter) GetAllDaemonSets() []*DaemonSet
GetAllDaemonSets returns all the cached DaemonSets
func (*ClusterImporter) GetAllDeployments ¶
func (ci *ClusterImporter) GetAllDeployments() []*Deployment
GetAllDeployments returns all the cached deployments
func (*ClusterImporter) GetAllJobs ¶
func (ci *ClusterImporter) GetAllJobs() []*Job
GetAllJobs returns all the cached jobs
func (*ClusterImporter) GetAllNamespaces ¶
func (ci *ClusterImporter) GetAllNamespaces() []*Namespace
GetAllNamespaces returns all the cached namespaces
func (*ClusterImporter) GetAllNodes ¶
func (ci *ClusterImporter) GetAllNodes() []*Node
GetAllNodes returns all the cached nodes
func (*ClusterImporter) GetAllPersistentVolumeClaims ¶
func (ci *ClusterImporter) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
GetAllPersistentVolumeClaims returns all the cached persistent volume claims
func (*ClusterImporter) GetAllPersistentVolumes ¶
func (ci *ClusterImporter) GetAllPersistentVolumes() []*PersistentVolume
GetAllPersistentVolumes returns all the cached persistent volumes
func (*ClusterImporter) GetAllPodDisruptionBudgets ¶
func (ci *ClusterImporter) GetAllPodDisruptionBudgets() []*PodDisruptionBudget
GetAllPodDisruptionBudgets returns all cached pod disruption budgets
func (*ClusterImporter) GetAllPods ¶
func (ci *ClusterImporter) GetAllPods() []*Pod
GetAllPods returns all the cached pods
func (*ClusterImporter) GetAllReplicaSets ¶
func (ci *ClusterImporter) GetAllReplicaSets() []*ReplicaSet
GetAllReplicaSets returns all the cached ReplicaSets
func (*ClusterImporter) GetAllReplicationControllers ¶
func (ci *ClusterImporter) GetAllReplicationControllers() []*ReplicationController
func (*ClusterImporter) GetAllServices ¶
func (ci *ClusterImporter) GetAllServices() []*Service
GetAllServices returns all the cached services
func (*ClusterImporter) GetAllStatefulSets ¶
func (ci *ClusterImporter) GetAllStatefulSets() []*StatefulSet
GetAllStatfulSets returns all the cached StatefulSets
func (*ClusterImporter) GetAllStorageClasses ¶
func (ci *ClusterImporter) GetAllStorageClasses() []*StorageClass
GetAllStorageClasses returns all the cached storage classes
type Container ¶ added in v1.114.0
type Container struct {
Name string
Resources v1.ResourceRequirements
}
type Deployment ¶ added in v1.114.0
type GenericStore ¶ added in v1.114.0
GenericStore is a generic store implementation. It converts objects to a different type using a transform function. The main purpose is to reduce a memory footprint by storing only the necessary data.
func CreateStore ¶ added in v1.114.0
func NewGenericStore ¶ added in v1.114.0
func NewGenericStore[Input UIDGetter, Output any](transformFunc func(input Input) Output) *GenericStore[Input, Output]
NewGenericStore creates a new instance of GenericStore.
func (*GenericStore[Input, Output]) Add ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) Add(obj any) error
Add inserts an object into the store.
func (*GenericStore[Input, Output]) Delete ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) Delete(obj any) error
Delete removes an object from the store.
func (*GenericStore[Input, Output]) Get ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) Get(_ interface{}) (item interface{}, exists bool, err error)
func (*GenericStore[Input, Output]) GetAll ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) GetAll() []Output
GetAll returns all stored objects.
func (*GenericStore[Input, Output]) GetByKey ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) GetByKey(_ string) (item interface{}, exists bool, err error)
func (*GenericStore[Input, Output]) List ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) List() []interface{}
Stubs to satisfy the cache.Store interface
func (*GenericStore[Input, Output]) ListKeys ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) ListKeys() []string
func (*GenericStore[Input, Output]) Replace ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) Replace(list []any, _ string) error
Replace replaces the current list of items in the store.
func (*GenericStore[Input, Output]) Resync ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) Resync() error
func (*GenericStore[Input, Output]) Update ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) Update(obj any) error
Update updates the existing entry in the store.
func (*GenericStore[Input, Output]) Watch ¶ added in v1.114.0
func (s *GenericStore[Input, Output]) Watch(stopCh <-chan struct{}, onInit func())
type KubernetesClusterCache ¶
type KubernetesClusterCache struct {
// contains filtered or unexported fields
}
KubernetesClusterCache is the implementation of ClusterCache
func (*KubernetesClusterCache) GetAllDaemonSets ¶
func (kcc *KubernetesClusterCache) GetAllDaemonSets() []*DaemonSet
func (*KubernetesClusterCache) GetAllDeployments ¶
func (kcc *KubernetesClusterCache) GetAllDeployments() []*Deployment
func (*KubernetesClusterCache) GetAllJobs ¶
func (kcc *KubernetesClusterCache) GetAllJobs() []*Job
func (*KubernetesClusterCache) GetAllNamespaces ¶
func (kcc *KubernetesClusterCache) GetAllNamespaces() []*Namespace
func (*KubernetesClusterCache) GetAllNodes ¶
func (kcc *KubernetesClusterCache) GetAllNodes() []*Node
func (*KubernetesClusterCache) GetAllPersistentVolumeClaims ¶
func (kcc *KubernetesClusterCache) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
func (*KubernetesClusterCache) GetAllPersistentVolumes ¶
func (kcc *KubernetesClusterCache) GetAllPersistentVolumes() []*PersistentVolume
func (*KubernetesClusterCache) GetAllPodDisruptionBudgets ¶
func (kcc *KubernetesClusterCache) GetAllPodDisruptionBudgets() []*PodDisruptionBudget
func (*KubernetesClusterCache) GetAllPods ¶
func (kcc *KubernetesClusterCache) GetAllPods() []*Pod
func (*KubernetesClusterCache) GetAllReplicaSets ¶
func (kcc *KubernetesClusterCache) GetAllReplicaSets() []*ReplicaSet
func (*KubernetesClusterCache) GetAllReplicationControllers ¶
func (kcc *KubernetesClusterCache) GetAllReplicationControllers() []*ReplicationController
func (*KubernetesClusterCache) GetAllServices ¶
func (kcc *KubernetesClusterCache) GetAllServices() []*Service
func (*KubernetesClusterCache) GetAllStatefulSets ¶
func (kcc *KubernetesClusterCache) GetAllStatefulSets() []*StatefulSet
func (*KubernetesClusterCache) GetAllStorageClasses ¶
func (kcc *KubernetesClusterCache) GetAllStorageClasses() []*StorageClass
func (*KubernetesClusterCache) Run ¶
func (kcc *KubernetesClusterCache) Run()
func (*KubernetesClusterCache) Stop ¶
func (kcc *KubernetesClusterCache) Stop()
type KubernetesClusterCacheV2 ¶ added in v1.114.0
type KubernetesClusterCacheV2 struct {
// contains filtered or unexported fields
}
func NewKubernetesClusterCacheV2 ¶ added in v1.114.0
func NewKubernetesClusterCacheV2(clientset kubernetes.Interface) *KubernetesClusterCacheV2
func (*KubernetesClusterCacheV2) GetAllDaemonSets ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllDaemonSets() []*DaemonSet
func (*KubernetesClusterCacheV2) GetAllDeployments ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllDeployments() []*Deployment
func (*KubernetesClusterCacheV2) GetAllJobs ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllJobs() []*Job
func (*KubernetesClusterCacheV2) GetAllNamespaces ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllNamespaces() []*Namespace
func (*KubernetesClusterCacheV2) GetAllNodes ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllNodes() []*Node
func (*KubernetesClusterCacheV2) GetAllPersistentVolumeClaims ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllPersistentVolumeClaims() []*PersistentVolumeClaim
func (*KubernetesClusterCacheV2) GetAllPersistentVolumes ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllPersistentVolumes() []*PersistentVolume
func (*KubernetesClusterCacheV2) GetAllPodDisruptionBudgets ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllPodDisruptionBudgets() []*PodDisruptionBudget
func (*KubernetesClusterCacheV2) GetAllPods ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllPods() []*Pod
func (*KubernetesClusterCacheV2) GetAllReplicaSets ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllReplicaSets() []*ReplicaSet
func (*KubernetesClusterCacheV2) GetAllReplicationControllers ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllReplicationControllers() []*ReplicationController
func (*KubernetesClusterCacheV2) GetAllServices ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllServices() []*Service
func (*KubernetesClusterCacheV2) GetAllStatefulSets ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllStatefulSets() []*StatefulSet
func (*KubernetesClusterCacheV2) GetAllStorageClasses ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) GetAllStorageClasses() []*StorageClass
func (*KubernetesClusterCacheV2) Run ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) Run()
func (*KubernetesClusterCacheV2) Stop ¶ added in v1.114.0
func (kcc *KubernetesClusterCacheV2) Stop()
type PersistentVolume ¶ added in v1.114.0
type PersistentVolume struct {
Name string
Namespace string
Labels map[string]string
Annotations map[string]string
Spec v1.PersistentVolumeSpec
Status v1.PersistentVolumeStatus
}
type PersistentVolumeClaim ¶ added in v1.114.0
type PodDisruptionBudget ¶ added in v1.114.0
type PodDisruptionBudget struct {
Name string
Namespace string
Spec policyv1.PodDisruptionBudgetSpec
Status policyv1.PodDisruptionBudgetStatus
}
type PodStatus ¶ added in v1.114.0
type PodStatus struct {
Phase v1.PodPhase
ContainerStatuses []v1.ContainerStatus
}
type ReplicaSet ¶ added in v1.114.0
type ReplicaSet struct {
Name string
Namespace string
SpecSelector *metav1.LabelSelector
Spec appsv1.ReplicaSetSpec
}
type ReplicationController ¶ added in v1.114.0
type ReplicationController struct {
Name string
Namespace string
Spec v1.ReplicationControllerSpec
}
type Service ¶ added in v1.114.0
type Service struct {
Name string
Namespace string
SpecSelector map[string]string
Type v1.ServiceType
Status v1.ServiceStatus
}
type StatefulSet ¶ added in v1.114.0
type StorageClass ¶ added in v1.114.0
type WatchController ¶
type WatchController interface {
// Initializes the cache
WarmUp(chan struct{})
// Run starts the watching process
Run(int, chan struct{})
// GetAll returns all of the resources
GetAll() []interface{}
// SetUpdateHandler sets a specific handler for adding/updating individual resources
SetUpdateHandler(WatchHandler) WatchController
// SetRemovedHandler sets a specific handler for removing individual resources
SetRemovedHandler(WatchHandler) WatchController
}
WatchController defines a contract for an object which watches a specific resource set for add, updates, and removals