Documentation
¶
Index ¶
- func ToPerc(v1, v2 int64) int64
- type ClusterMetricsLister
- type ClusterRoleBindingLister
- type Collector
- type ConfigLister
- type ConfigMap
- type ConfigMapLister
- type ConsumptionMetrics
- type Container
- type DeployLister
- type Deployment
- type DeploymentLister
- type EndPointLister
- type HorizontalPodAutoscaler
- type HpaLister
- type LimitCollector
- type Namespace
- type NamespaceLister
- type NamespaceRefs
- type Node
- type NodeLimiter
- type NodeLister
- type NodeMetricsLister
- type PersistentVolume
- type PersistentVolumeClaim
- type PersistentVolumeClaimLister
- type PersistentVolumeLister
- type Pod
- type PodGetter
- type PodLimiter
- type PodLister
- type PodMXLister
- type PodMetric
- type PodMetricsLister
- type PodRefs
- type PodSelectorLister
- type PodsMetricsLister
- type RoleBindingLister
- type SARefs
- type Secret
- type SecretLister
- type Service
- type ServiceAccount
- type ServiceAccountLister
- type ServiceLister
- type StatefulSet
- type StatefulSetLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusterMetricsLister ¶
type ClusterMetricsLister interface {
ListClusterMetrics() v1.ResourceList
}
ClusterMetricsLister handles cluster metrics.
type ClusterRoleBindingLister ¶
type ClusterRoleBindingLister interface {
ListClusterRoleBindings() map[string]*rbacv1.ClusterRoleBinding
}
ClusterRoleBindingLister list all available ClusterRoleBindings.
type Collector ¶
type Collector interface { Outcome() issues.Outcome AddError(s, desc string) AddErrorf(s, fmat string, args ...interface{}) AddSubOk(p, s, desc string) AddSubOkf(p, s, fmat string, args ...interface{}) AddSubInfo(p, s, desc string) AddSubInfof(p, s, fmat string, args ...interface{}) AddSubWarn(p, s, desc string) AddSubWarnf(p, s, fmat string, args ...interface{}) AddSubError(p, s, desc string) AddSubErrorf(p, s, fmat string, args ...interface{}) }
Collector collects sub issues.
type ConfigLister ¶
type ConfigLister interface { CPUResourceLimits() config.Allocations MEMResourceLimits() config.Allocations }
ConfigLister tracks configuration parameters.
type ConfigMap ¶
type ConfigMap struct { *issues.Collector ConfigMapLister }
ConfigMap tracks ConfigMap sanitization.
func NewConfigMap ¶
func NewConfigMap(c *issues.Collector, lister ConfigMapLister) *ConfigMap
NewConfigMap returns a new ConfigMap sanitizer.
type ConfigMapLister ¶
ConfigMapLister list available ConfigMaps on a cluster.
type ConsumptionMetrics ¶
type ConsumptionMetrics struct { CurrentCPU resource.Quantity CurrentMEM resource.Quantity RequestedCPU resource.Quantity RequestedMEM resource.Quantity RequestedStorage resource.Quantity }
ConsumptionMetrics tracks managed pods resource utilization.
func (*ConsumptionMetrics) ReqCPURatio ¶
func (d *ConsumptionMetrics) ReqCPURatio() int64
ReqCPURatio returns current cpu usage over requested percentage.
func (*ConsumptionMetrics) ReqMEMRatio ¶
func (d *ConsumptionMetrics) ReqMEMRatio() int64
ReqMEMRatio returns current memory usage over requested percentage.
type Container ¶
type Container struct { LimitCollector // contains filtered or unexported fields }
Container represents a Container linter.
func NewContainer ¶
func NewContainer(fqn string, c LimitCollector) *Container
NewContainer returns a new container linter.
type DeployLister ¶
type DeployLister interface {
ListDeployments() map[string]*appsv1.Deployment
}
DeployLister list deployments.
type Deployment ¶
type Deployment struct { *issues.Collector DeploymentLister }
Deployment tracks Deployment sanitization.
func NewDeployment ¶
func NewDeployment(co *issues.Collector, lister DeploymentLister) *Deployment
NewDeployment returns a new Deployment sanitizer.
type DeploymentLister ¶
type DeploymentLister interface { PodLimiter PodsMetricsLister PodSelectorLister ConfigLister DeployLister }
DeploymentLister list available Deployments on a cluster.
type EndPointLister ¶
EndPointLister find all service endpoints.
type HorizontalPodAutoscaler ¶
HorizontalPodAutoscaler represents a HorizontalPodAutoscaler linter.
func NewHorizontalPodAutoscaler ¶
func NewHorizontalPodAutoscaler(co *issues.Collector, lister HpaLister) *HorizontalPodAutoscaler
NewHorizontalPodAutoscaler returns a new ServiceAccount linter.
type HpaLister ¶
type HpaLister interface { DeployLister StatefulSetLister ClusterMetricsLister NodeMetricsLister ListHorizontalPodAutoscalers() map[string]*autoscalingv1.HorizontalPodAutoscaler }
HpaLister list available hpas on a cluster.
type LimitCollector ¶
type LimitCollector interface { Collector PodLimiter }
LimitCollector represents a collector with resource limits.
type Namespace ¶
type Namespace struct { *issues.Collector NamespaceLister }
Namespace represents a Namespace sanitizer.
func NewNamespace ¶
func NewNamespace(co *issues.Collector, lister NamespaceLister) *Namespace
NewNamespace returns a new namespace linter.
type NamespaceLister ¶
type NamespaceLister interface { NamespaceRefs ListNamespaces() map[string]*v1.Namespace }
NamespaceLister lists all namespaces.
type NamespaceRefs ¶
type NamespaceRefs interface {
ReferencedNamespaces(map[string]struct{})
}
NamespaceRefs tracks namespace references in the cluster.
type Node ¶
type Node struct { *issues.Collector NodeLister }
Node represents a Node linter.
type NodeLimiter ¶
NodeLimiter tracks metrics limit range.
type NodeLister ¶
type NodeLister interface { NodeMetricsLister PodLister NodeLimiter ListNodes() map[string]*v1.Node }
NodeLister lists available nodes.
type NodeMetricsLister ¶
type NodeMetricsLister interface {
ListNodesMetrics() map[string]*mv1beta1.NodeMetrics
}
NodeMetricsLister handle
type PersistentVolume ¶
type PersistentVolume struct { *issues.Collector PersistentVolumeLister }
PersistentVolume represents a PersistentVolume sanitizer.
func NewPersistentVolume ¶
func NewPersistentVolume(co *issues.Collector, lister PersistentVolumeLister) *PersistentVolume
NewPersistentVolume returns a new PersistentVolume sanitizer.
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct { *issues.Collector PersistentVolumeClaimLister }
PersistentVolumeClaim represents a PersistentVolumeClaim sanitizer.
func NewPersistentVolumeClaim ¶
func NewPersistentVolumeClaim(co *issues.Collector, lister PersistentVolumeClaimLister) *PersistentVolumeClaim
NewPersistentVolumeClaim returns a new PersistentVolumeClaim sanitizer.
type PersistentVolumeClaimLister ¶
type PersistentVolumeClaimLister interface { ListPersistentVolumeClaims() map[string]*v1.PersistentVolumeClaim PodLister }
PersistentVolumeClaimLister list available PersistentVolumeClaim on a cluster.
type PersistentVolumeLister ¶
type PersistentVolumeLister interface {
ListPersistentVolumes() map[string]*v1.PersistentVolume
}
PersistentVolumeLister list available PersistentVolume on a cluster.
type Pod ¶
type Pod struct { *issues.Collector PodMXLister }
Pod represents a Pod linter.
type PodLimiter ¶
PodLimiter tracks metrics limit range.
type PodMXLister ¶
type PodMXLister interface { PodLimiter PodMetricsLister PodLister }
PodMXLister list available pods.
type PodMetricsLister ¶
type PodMetricsLister interface {
ListPodsMetrics() map[string]*mv1beta1.PodMetrics
}
PodMetricsLister handles pods metrics.
type PodRefs ¶
type PodRefs interface {
PodRefs(cache.ObjReferences)
}
PodRefs tracks pods object references.
type PodSelectorLister ¶
type PodSelectorLister interface {
ListPodsBySelector(sel *metav1.LabelSelector) map[string]*v1.Pod
}
PodSelectorLister list a collection of pod matching a selector.
type PodsMetricsLister ¶
type PodsMetricsLister interface {
ListPodsMetrics() map[string]*mv1beta1.PodMetrics
}
PodsMetricsLister handles pods metrics.
type RoleBindingLister ¶
type RoleBindingLister interface {
ListRoleBindings() map[string]*rbacv1.RoleBinding
}
RoleBindingLister list all available ClusterRoleBindings.
type SARefs ¶
type SARefs interface {
ServiceAccountRefs(cache.ObjReferences)
}
SARefs tracks ServiceAccount object references.
type Secret ¶
type Secret struct { *issues.Collector SecretLister }
Secret tracks Secret sanitization.
type SecretLister ¶
SecretLister list available Secrets on a cluster.
type Service ¶
type Service struct { *issues.Collector ServiceLister }
Service represents a service linter.
func NewService ¶
func NewService(co *issues.Collector, lister ServiceLister) *Service
NewService returns a new service linter.
type ServiceAccount ¶
type ServiceAccount struct { *issues.Collector ServiceAccountLister }
ServiceAccount tracks ServiceAccount sanitizer.
func NewServiceAccount ¶
func NewServiceAccount(co *issues.Collector, lister ServiceAccountLister) *ServiceAccount
NewServiceAccount returns a new ServiceAccount linter.
type ServiceAccountLister ¶
type ServiceAccountLister interface { PodLister ClusterRoleBindingLister RoleBindingLister ListServiceAccounts() map[string]*v1.ServiceAccount }
ServiceAccountLister list available ServiceAccounts on a cluster.
type ServiceLister ¶
type ServiceLister interface { PodGetter EndPointLister ListServices() map[string]*v1.Service }
ServiceLister list available Services on a cluster.
type StatefulSet ¶
type StatefulSet struct { *issues.Collector StatefulSetLister }
StatefulSet represents a StatefulSet sanitizer.
func NewStatefulSet ¶
func NewStatefulSet(co *issues.Collector, lister StatefulSetLister) *StatefulSet
NewStatefulSet returns a new StatefulSet linter.
type StatefulSetLister ¶
type StatefulSetLister interface { PodLimiter ConfigLister PodSelectorLister PodsMetricsLister ListStatefulSets() map[string]*appsv1.StatefulSet }
StatefulSetLister handles statefulsets.