Documentation ¶
Index ¶
- func ToPerc(v1, v2 int64) int64
- type Cluster
- type ClusterLister
- type ClusterRole
- type ClusterRoleBinding
- type Collector
- type CollectorLimiter
- type ConfigLister
- type ConfigMap
- type ConsumptionMetrics
- func (d *ConsumptionMetrics) LimitCPURatio() float64
- func (d *ConsumptionMetrics) LimitMEMRatio() float64
- func (d *ConsumptionMetrics) ReqAbsCPURatio() float64
- func (d *ConsumptionMetrics) ReqAbsMEMRatio() float64
- func (d *ConsumptionMetrics) ReqCPURatio() float64
- func (d *ConsumptionMetrics) ReqMEMRatio() float64
- type Container
- type ContainerRestrictor
- type CronJob
- type DaemonSet
- type Deployment
- type Gateway
- type GatewayClass
- type HTTPRoute
- type HorizontalPodAutoscaler
- type Ingress
- type Job
- type Labels
- type LimitCollector
- type Namespace
- type NetworkPolicy
- type Node
- type PersistentVolume
- type PersistentVolumeClaim
- type Pod
- type PodDisruptionBudget
- type PodLimiter
- type PodMetric
- type PodSelectorLister
- type PodsMetricsLister
- type ReplicaSet
- type Role
- type RoleBinding
- type Secret
- type Service
- type ServiceAccount
- type StatefulSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cluster ¶
type Cluster struct { *issues.Collector ClusterLister }
Cluster tracks cluster sanitization.
func NewCluster ¶
func NewCluster(co *issues.Collector, lister ClusterLister) *Cluster
NewCluster returns a new instance.
type ClusterLister ¶
ClusterLister list available Clusters on a cluster.
type ClusterRole ¶
ClusterRole tracks ClusterRole sanitization.
func NewClusterRole ¶
func NewClusterRole(c *issues.Collector, db *db.DB) *ClusterRole
NewClusterRole returns a new instance.
type ClusterRoleBinding ¶
ClusterRoleBinding tracks ClusterRoleBinding sanitization.
func NewClusterRoleBinding ¶
func NewClusterRoleBinding(c *issues.Collector, db *db.DB) *ClusterRoleBinding
NewClusterRoleBinding returns a new instance.
type Collector ¶
type Collector interface { // Outcome collects issues. Outcome() issues.Outcome // AddSubCode records a sub issue. AddSubCode(context.Context, rules.ID, ...interface{}) // AddCode records a new issue. AddCode(context.Context, rules.ID, ...interface{}) // AddErr records errors. AddErr(context.Context, ...error) }
Collector collects sub issues.
type CollectorLimiter ¶
type CollectorLimiter interface { // Collector an issue collector. Collector // ConfigLister track config options. ConfigLister }
CollectorLimiter represents a collector with resource allocation limits.
type ConfigLister ¶
type ConfigLister interface { // CPUResourceLimits returns the CPU utilization threshold. CPUResourceLimits() config.Allocations // MEMResourceLimits returns the MEM utilization threshold. MEMResourceLimits() config.Allocations }
ConfigLister tracks configuration parameters.
type ConfigMap ¶
ConfigMap tracks ConfigMap sanitization.
func NewConfigMap ¶
NewConfigMap returns a new instance.
type ConsumptionMetrics ¶
type ConsumptionMetrics struct { QOS v1.PodQOSClass CurrentCPU, CurrentMEM resource.Quantity RequestCPU, RequestMEM resource.Quantity LimitCPU, LimitMEM resource.Quantity RequestedStorage resource.Quantity }
ConsumptionMetrics tracks managed pods resource utilization.
func (*ConsumptionMetrics) LimitCPURatio ¶
func (d *ConsumptionMetrics) LimitCPURatio() float64
LimitCPURatio returns current cpu usage over requested percentage.
func (*ConsumptionMetrics) LimitMEMRatio ¶
func (d *ConsumptionMetrics) LimitMEMRatio() float64
LimitMEMRatio returns current memory usage over requested percentage.
func (*ConsumptionMetrics) ReqAbsCPURatio ¶
func (d *ConsumptionMetrics) ReqAbsCPURatio() float64
ReqAbsCPURatio returns absolute cpu ratio.
func (*ConsumptionMetrics) ReqAbsMEMRatio ¶
func (d *ConsumptionMetrics) ReqAbsMEMRatio() float64
ReqAbsMEMRatio returns absolute mem ratio.
func (*ConsumptionMetrics) ReqCPURatio ¶
func (d *ConsumptionMetrics) ReqCPURatio() float64
ReqCPURatio returns current cpu usage over requested percentage.
func (*ConsumptionMetrics) ReqMEMRatio ¶
func (d *ConsumptionMetrics) ReqMEMRatio() float64
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 instance.
type ContainerRestrictor ¶
type ContainerRestrictor interface {
AllowedRegistries() []string
}
type DaemonSet ¶
DaemonSet tracks DaemonSet sanitization.
func NewDaemonSet ¶
NewDaemonSet returns a new instance.
type Deployment ¶
Deployment tracks Deployment sanitization.
func NewDeployment ¶
func NewDeployment(co *issues.Collector, db *db.DB) *Deployment
NewDeployment returns a new instance.
type Gateway ¶
Gateway tracks Gateway sanitization.
func NewGateway ¶
NewGateway returns a new instance.
type GatewayClass ¶
GatewayClass tracks GatewayClass sanitization.
func NewGatewayClass ¶
func NewGatewayClass(co *issues.Collector, db *db.DB) *GatewayClass
NewGatewayClass returns a new instance.
type HTTPRoute ¶
HTTPRoute tracks HTTPRoute sanitization.
func NewHTTPRoute ¶
NewHTTPRoute returns a new instance.
type HorizontalPodAutoscaler ¶
HorizontalPodAutoscaler represents a HorizontalPodAutoscaler linter.
func NewHorizontalPodAutoscaler ¶
func NewHorizontalPodAutoscaler(co *issues.Collector, db *db.DB) *HorizontalPodAutoscaler
NewHorizontalPodAutoscaler returns a new instance.
type Ingress ¶
Ingress tracks Ingress sanitization.
func NewIngress ¶
NewIngress returns a new instance.
type LimitCollector ¶
type LimitCollector interface { Collector PodLimiter ContainerRestrictor }
LimitCollector represents a collector with resource limits.
type Namespace ¶
Namespace represents a Namespace linter.
func NewNamespace ¶
NewNamespace returns a new instance.
func (*Namespace) ReferencedNamespaces ¶
ReferencedNamespaces fetch all namespaces referenced by pods and service accounts.
type NetworkPolicy ¶
NetworkPolicy tracks NetworkPolicy sanitizatios.
func NewNetworkPolicy ¶
func NewNetworkPolicy(co *issues.Collector, db *db.DB) *NetworkPolicy
NewNetworkPolicy returns a new instance.
type PersistentVolume ¶
PersistentVolume represents a PersistentVolume linter.
func NewPersistentVolume ¶
func NewPersistentVolume(co *issues.Collector, db *db.DB) *PersistentVolume
NewPersistentVolume returns a new instance.
type PersistentVolumeClaim ¶
PersistentVolumeClaim represents a PersistentVolumeClaim linter.
func NewPersistentVolumeClaim ¶
func NewPersistentVolumeClaim(co *issues.Collector, db *db.DB) *PersistentVolumeClaim
NewPersistentVolumeClaim returns a new instance.
type Pod ¶
Pod represents a Pod linter.
type PodDisruptionBudget ¶
PodDisruptionBudget tracks PodDisruptionBudget sanitization.
func NewPodDisruptionBudget ¶
func NewPodDisruptionBudget(c *issues.Collector, db *db.DB) *PodDisruptionBudget
NewPodDisruptionBudget returns a new PodDisruptionBudget linter.
type PodLimiter ¶
PodLimiter tracks metrics limit range.
type PodSelectorLister ¶
type PodSelectorLister interface {
ListPodsBySelector(ns string, 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 ReplicaSet ¶
ReplicaSet tracks ReplicaSet sanitization.
func NewReplicaSet ¶
func NewReplicaSet(co *issues.Collector, db *db.DB) *ReplicaSet
NewReplicaSet returns a new instance.
type RoleBinding ¶
RoleBinding tracks RoleBinding sanitization.
func NewRoleBinding ¶
func NewRoleBinding(c *issues.Collector, db *db.DB) *RoleBinding
NewRoleBinding returns a new instance.
type Service ¶
Service represents a service linter.
func NewService ¶
NewService returns a new instance.
type ServiceAccount ¶
ServiceAccount tracks ServiceAccount linter.
func NewServiceAccount ¶
func NewServiceAccount(co *issues.Collector, db *db.DB) *ServiceAccount
NewServiceAccount returns a new instance.
type StatefulSet ¶
StatefulSet represents a StatefulSet linter.
func NewStatefulSet ¶
func NewStatefulSet(co *issues.Collector, db *db.DB) *StatefulSet
NewStatefulSet returns a new instance.