Documentation
¶
Index ¶
- func Phase(po *v1.Pod) string
- func SpecFor(fqn string, o metav1.ObjectMetaAccessor) rules.Spec
- 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 ¶
type ClusterLister interface {
ListVersion() (*semver.Version, error)
HasMetrics() bool
}
ClusterLister list available Clusters on a cluster.
type ClusterRole ¶
type ClusterRole struct {
*issues.Collector
// contains filtered or unexported fields
}
ClusterRole tracks ClusterRole sanitization.
func NewClusterRole ¶
func NewClusterRole(c *issues.Collector, db *db.DB) *ClusterRole
NewClusterRole returns a new instance.
type ClusterRoleBinding ¶
type ClusterRoleBinding struct {
*issues.Collector
// contains filtered or unexported fields
}
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 ¶
type ConfigMap struct {
*issues.Collector
// contains filtered or unexported fields
}
ConfigMap tracks ConfigMap sanitization.
func NewConfigMap ¶
func NewConfigMap(c *issues.Collector, db *db.DB) *ConfigMap
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 CronJob ¶
type CronJob struct {
*issues.Collector
// contains filtered or unexported fields
}
CronJob tracks CronJob linting.
func NewCronJob ¶
func NewCronJob(co *issues.Collector, db *db.DB) *CronJob
NewCronJob returns a new instance.
type DaemonSet ¶
type DaemonSet struct {
*issues.Collector
// contains filtered or unexported fields
}
DaemonSet tracks DaemonSet sanitization.
func NewDaemonSet ¶
func NewDaemonSet(co *issues.Collector, db *db.DB) *DaemonSet
NewDaemonSet returns a new instance.
type Deployment ¶
type Deployment struct {
*issues.Collector
// contains filtered or unexported fields
}
Deployment tracks Deployment sanitization.
func NewDeployment ¶
func NewDeployment(co *issues.Collector, db *db.DB) *Deployment
NewDeployment returns a new instance.
type Gateway ¶
type Gateway struct {
*issues.Collector
// contains filtered or unexported fields
}
Gateway tracks Gateway sanitization.
func NewGateway ¶
func NewGateway(co *issues.Collector, db *db.DB) *Gateway
NewGateway returns a new instance.
type GatewayClass ¶
type GatewayClass struct {
*issues.Collector
// contains filtered or unexported fields
}
GatewayClass tracks GatewayClass sanitization.
func NewGatewayClass ¶
func NewGatewayClass(co *issues.Collector, db *db.DB) *GatewayClass
NewGatewayClass returns a new instance.
type HTTPRoute ¶
type HTTPRoute struct {
*issues.Collector
// contains filtered or unexported fields
}
HTTPRoute tracks HTTPRoute sanitization.
func NewHTTPRoute ¶
func NewHTTPRoute(co *issues.Collector, db *db.DB) *HTTPRoute
NewHTTPRoute returns a new instance.
type HorizontalPodAutoscaler ¶
type HorizontalPodAutoscaler struct {
*issues.Collector
// contains filtered or unexported fields
}
HorizontalPodAutoscaler represents a HorizontalPodAutoscaler linter.
func NewHorizontalPodAutoscaler ¶
func NewHorizontalPodAutoscaler(co *issues.Collector, db *db.DB) *HorizontalPodAutoscaler
NewHorizontalPodAutoscaler returns a new instance.
type Ingress ¶
type Ingress struct {
*issues.Collector
// contains filtered or unexported fields
}
Ingress tracks Ingress sanitization.
func NewIngress ¶
func NewIngress(co *issues.Collector, db *db.DB) *Ingress
NewIngress returns a new instance.
type Job ¶
type Job struct {
*issues.Collector
// contains filtered or unexported fields
}
Job tracks Job linting.
type LimitCollector ¶
type LimitCollector interface {
Collector
PodLimiter
ContainerRestrictor
}
LimitCollector represents a collector with resource limits.
type Namespace ¶
type Namespace struct {
*issues.Collector
// contains filtered or unexported fields
}
Namespace represents a Namespace linter.
func NewNamespace ¶
func NewNamespace(co *issues.Collector, db *db.DB) *Namespace
NewNamespace returns a new instance.
func (*Namespace) Lint ¶
func (s *Namespace) Lint(ctx context.Context) error
Lint cleanse the resource.
func (*Namespace) ReferencedNamespaces ¶
func (s *Namespace) ReferencedNamespaces(res map[string]struct{}) error
ReferencedNamespaces fetch all namespaces referenced by pods and service accounts.
type NetworkPolicy ¶
type NetworkPolicy struct {
*issues.Collector
// contains filtered or unexported fields
}
NetworkPolicy tracks NetworkPolicy linting.
func NewNetworkPolicy ¶
func NewNetworkPolicy(co *issues.Collector, db *db.DB) *NetworkPolicy
NewNetworkPolicy returns a new instance.
type Node ¶
type Node struct {
*issues.Collector
// contains filtered or unexported fields
}
Node represents a Node linter.
type PersistentVolume ¶
type PersistentVolume struct {
*issues.Collector
// contains filtered or unexported fields
}
PersistentVolume represents a PersistentVolume linter.
func NewPersistentVolume ¶
func NewPersistentVolume(co *issues.Collector, db *db.DB) *PersistentVolume
NewPersistentVolume returns a new instance.
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct {
*issues.Collector
// contains filtered or unexported fields
}
PersistentVolumeClaim represents a PersistentVolumeClaim linter.
func NewPersistentVolumeClaim ¶
func NewPersistentVolumeClaim(co *issues.Collector, db *db.DB) *PersistentVolumeClaim
NewPersistentVolumeClaim returns a new instance.
type Pod ¶
type Pod struct {
*issues.Collector
// contains filtered or unexported fields
}
Pod represents a Pod linter.
type PodDisruptionBudget ¶
type PodDisruptionBudget struct {
*issues.Collector
// contains filtered or unexported fields
}
PodDisruptionBudget tracks PodDisruptionBudget sanitization.
func NewPodDisruptionBudget ¶
func NewPodDisruptionBudget(c *issues.Collector, db *db.DB) *PodDisruptionBudget
NewPodDisruptionBudget returns a new PodDisruptionBudget linter.
type PodLimiter ¶
type PodLimiter interface {
PodCPULimit() float64
PodMEMLimit() float64
RestartsLimit() int
}
PodLimiter tracks metrics limit range.
type PodMetric ¶
type PodMetric interface {
CurrentCPU() int64
CurrentMEM() int64
Empty() bool
}
PodMetric tracks pod metrics available and current 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 ¶
type ReplicaSet struct {
*issues.Collector
// contains filtered or unexported fields
}
ReplicaSet tracks ReplicaSet sanitization.
func NewReplicaSet ¶
func NewReplicaSet(co *issues.Collector, db *db.DB) *ReplicaSet
NewReplicaSet returns a new instance.
type Role ¶
type Role struct {
*issues.Collector
// contains filtered or unexported fields
}
Role tracks Role sanitization.
type RoleBinding ¶
type RoleBinding struct {
*issues.Collector
// contains filtered or unexported fields
}
RoleBinding tracks RoleBinding sanitization.
func NewRoleBinding ¶
func NewRoleBinding(c *issues.Collector, db *db.DB) *RoleBinding
NewRoleBinding returns a new instance.
type Secret ¶
type Secret struct {
*issues.Collector
// contains filtered or unexported fields
}
Secret tracks Secret sanitization.
type Service ¶
type Service struct {
*issues.Collector
// contains filtered or unexported fields
}
Service represents a service linter.
func NewService ¶
func NewService(co *issues.Collector, db *db.DB) *Service
NewService returns a new instance.
type ServiceAccount ¶
type ServiceAccount struct {
*issues.Collector
// contains filtered or unexported fields
}
ServiceAccount tracks ServiceAccount linter.
func NewServiceAccount ¶
func NewServiceAccount(co *issues.Collector, db *db.DB) *ServiceAccount
NewServiceAccount returns a new instance.
type StatefulSet ¶
type StatefulSet struct {
*issues.Collector
// contains filtered or unexported fields
}
StatefulSet represents a StatefulSet linter.
func NewStatefulSet ¶
func NewStatefulSet(co *issues.Collector, db *db.DB) *StatefulSet
NewStatefulSet returns a new instance.