rules

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRDEnabledModulesRuleName = "crd-enabled-modules"

	// MinimalDeckhouseVersionForCRDModulesRemoval is the Deckhouse version starting
	// from which the standalone "<module>-crd" modules were removed (Deckhouse PR
	// #9593 "Get rid of crd modules", first released in v1.65.0). Their CRDs are now
	// discovered and installed automatically from the parent module's crds/ directory,
	// so a separate "-crd" module no longer exists and referencing its name through
	// .Values.global.enabledModules is a deprecated pattern that should use the parent
	// module name (without the "-crd" suffix) instead.
	//
	// The rule only fires for modules whose requirements.deckhouse constraint starts
	// at or above this version; modules that still support older Deckhouse releases
	// (or declare no deckhouse requirement) are out of scope, mirroring the other
	// version-gated checks in dmt.
	MinimalDeckhouseVersionForCRDModulesRemoval = "1.65.0"
)
View Source
const (
	HTTPRouteRuleName = "httproute-rules"
	IngressKind       = "Ingress"
	HTTPRouteKind     = "HTTPRoute"
	ListenerSetKind   = "ListenerSet"
	AppLabelKey       = "app"
)
View Source
const (
	WebhookConfigurationRuleName = "webhook-configuration-annotations"

	AnnotationWeight                 = "werf.io/weight"
	AnnotationDeployDependency       = "werf.io/deploy-dependency"
	AnnotationDeployDependencyPrefix = "werf.io/deploy-dependency-"
)
View Source
const (
	ClusterDomainRuleName = "cluster-domain"
)
View Source
const (
	// DefaultContainerResourcePolicy can be passed as
	// ContainerResourcePolicy.ContainerName to specify the default policy.
	DefaultContainerResourcePolicy = "*"
)
View Source
const (
	EnabledModulesRuleName = "enabled-modules"
)
View Source
const (
	GrafanaRuleName = "grafana-dashboards"
)
View Source
const HelmRenderRuleName = "helm-render"
View Source
const (
	IngressRuleName = "ingress-rules"
)
View Source
const (
	KubeRbacProxyRuleName = "kube-rbac-proxy"
)
View Source
const (
	MountPointsRuleName = "mount-points"
)
View Source
const OpenAPIValuesQuoteRuleName = "openapi-values-quote"

OpenAPIValuesQuoteRuleName is the rule id reported in findings and used as the config key (templates.rules.openapi-values-quote / exclude-rules key).

View Source
const (
	PDBRuleName = "pdb"
)
View Source
const (
	PrometheusRuleName = "prometheus-rules"
)
View Source
const (
	RegistryRuleName = "registry"
)
View Source
const SchemaValidationRuleName = "schema-validation"
View Source
const (
	ServicePortRuleName = "service-port"
)
View Source
const (
	VPARuleName = "vpa"
)
View Source
const (
	WerfRuleName = "werf"
)

Variables

This section is empty.

Functions

func IsPodController

func IsPodController(kind string) bool

Types

type CRDEnabledModulesRule added in v0.1.103

type CRDEnabledModulesRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewCRDEnabledModulesRule added in v0.1.103

func NewCRDEnabledModulesRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *CRDEnabledModulesRule

func (*CRDEnabledModulesRule) Check added in v0.2.0

Check scans the module templates for deprecated references to standalone "-crd" modules through .Values.global.enabledModules and reports each one, offering an autofix that drops the "-crd" suffix. The check is gated on the module's target Deckhouse version (see MinimalDeckhouseVersionForCRDModulesRemoval).

type ClusterDomainRule added in v0.1.32

type ClusterDomainRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewClusterDomainRule added in v0.1.32

func NewClusterDomainRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *ClusterDomainRule

func (*ClusterDomainRule) Check added in v0.2.0

func (r *ClusterDomainRule) Check(_ context.Context)

type ContainerControlledValues

type ContainerControlledValues string

ContainerControlledValues controls which resource value should be autoscaled. +kubebuilder:validation:Enum=RequestsAndLimits;RequestsOnly

const (
	// ContainerControlledValuesRequestsAndLimits means resource request and limits
	// are scaled automatically. The limit is scaled proportionally to the request.
	ContainerControlledValuesRequestsAndLimits ContainerControlledValues = "RequestsAndLimits"
	// ContainerControlledValuesRequestsOnly means only requested resource is autoscaled.
	ContainerControlledValuesRequestsOnly ContainerControlledValues = "RequestsOnly"
)

type ContainerResourcePolicy

type ContainerResourcePolicy struct {
	// Name of the container or DefaultContainerResourcePolicy, in which
	// case the policy is used by the containers that don't have their own
	// policy specified.
	ContainerName string `json:"containerName,omitempty" protobuf:"bytes,1,opt,name=containerName"`
	// Whether autoscaler is enabled for the container. The default is "Auto".
	// +optional
	Mode *ContainerScalingMode `json:"mode,omitempty" protobuf:"bytes,2,opt,name=mode"`
	// Specifies the minimal amount of resources that will be recommended
	// for the container. The default is no minimum.
	// +optional
	MinAllowed v1.ResourceList `json:"minAllowed,omitempty" protobuf:"bytes,3,rep,name=minAllowed,casttype=ResourceList,castkey=ResourceName"`
	// Specifies the maximum amount of resources that will be recommended
	// for the container. The default is no maximum.
	// +optional
	MaxAllowed v1.ResourceList `json:"maxAllowed,omitempty" protobuf:"bytes,4,rep,name=maxAllowed,casttype=ResourceList,castkey=ResourceName"`

	// Specifies the type of recommendations that will be computed
	// (and possibly applied) by VPA.
	// If not specified, the default of [ResourceCPU, ResourceMemory] will be used.
	ControlledResources *[]v1.ResourceName `json:"controlledResources,omitempty" patchStrategy:"merge" protobuf:"bytes,5,rep,name=controlledResources"`

	// Specifies which resource values should be controlled.
	// The default is "RequestsAndLimits".
	// +optional
	ControlledValues *ContainerControlledValues `json:"controlledValues,omitempty" protobuf:"bytes,6,rep,name=controlledValues"`
}

ContainerResourcePolicy controls how autoscaler computes the recommended resources for a specific container.

type ContainerScalingMode

type ContainerScalingMode string

ContainerScalingMode controls whether autoscaler is enabled for a specific container. +kubebuilder:validation:Enum=Auto;Off

const (
	// ContainerScalingModeAuto means autoscaling is enabled for a container.
	ContainerScalingModeAuto ContainerScalingMode = "Auto"
	// ContainerScalingModeOff means autoscaling is disabled for a container.
	ContainerScalingModeOff ContainerScalingMode = "Off"
)

type EnabledModulesRule added in v0.1.77

type EnabledModulesRule struct {
	pkg.RuleMeta
	pkg.PathRule
	// contains filtered or unexported fields
}

func NewEnabledModulesRule added in v0.1.77

func NewEnabledModulesRule(excludeFileRules []pkg.StringRuleExclude,
	excludeDirectoryRules []pkg.DirectoryRuleExclude,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *EnabledModulesRule

func (*EnabledModulesRule) Check added in v0.2.0

func (r *EnabledModulesRule) Check(_ context.Context)

type GrafanaRule

type GrafanaRule struct {
	pkg.RuleMeta
	pkg.BoolRule
	// contains filtered or unexported fields
}

func NewGrafanaRule

func NewGrafanaRule(cfg *pkg.TemplatesLinterConfig, m pkg.Module, errorList *errors.LintRuleErrorsList) *GrafanaRule

func (*GrafanaRule) Check added in v0.2.0

func (r *GrafanaRule) Check(_ context.Context)

type HTTPRouteRule added in v0.1.88

type HTTPRouteRule struct {
	pkg.RuleMeta
	pkg.KindRule
	// contains filtered or unexported fields
}

func NewHTTPRouteRule added in v0.1.88

func NewHTTPRouteRule(excludeRules []pkg.KindRuleExclude, m pkg.Module, errorList *errors.LintRuleErrorsList) *HTTPRouteRule

func (*HTTPRouteRule) Check added in v0.2.0

func (r *HTTPRouteRule) Check(_ context.Context)

type HelmRenderRule added in v0.1.96

type HelmRenderRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewHelmRenderRule added in v0.1.96

func NewHelmRenderRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *HelmRenderRule

func (*HelmRenderRule) Check added in v0.1.96

func (r *HelmRenderRule) Check(ctx context.Context)

Check strictly renders module templates through nelm's public action.ChartRender and reports any rendering error as a lint finding. Strict rendering (no LintMode) catches template errors the main lenient render suppresses. Image references resolve from the module's pre-computed .Values (global.modulesImages, scanned from images/), so no helm_lib template override is needed here.

type HistogramCheckpoint

type HistogramCheckpoint struct {
	// Reference timestamp for samples collected within this histogram.
	// +nullable
	ReferenceTimestamp metav1.Time `json:"referenceTimestamp,omitempty" protobuf:"bytes,1,opt,name=referenceTimestamp"`

	// Map from bucket index to bucket weight.
	// +kubebuilder:validation:Type=object
	// +kubebuilder:validation:XPreserveUnknownFields
	BucketWeights map[int]uint32 `json:"bucketWeights,omitempty" protobuf:"bytes,2,opt,name=bucketWeights"`

	// Sum of samples to be used as denominator for weights from BucketWeights.
	TotalWeight float64 `json:"totalWeight,omitempty" protobuf:"bytes,3,opt,name=totalWeight"`
}

HistogramCheckpoint contains data needed to reconstruct the histogram.

type IngressRule added in v0.1.28

type IngressRule struct {
	pkg.RuleMeta
	pkg.KindRule
	// contains filtered or unexported fields
}

func NewIngressRule added in v0.1.28

func NewIngressRule(excludeRules []pkg.KindRuleExclude, m pkg.Module, errorList *errors.LintRuleErrorsList) *IngressRule

func (*IngressRule) Check added in v0.2.0

func (r *IngressRule) Check(_ context.Context)

type KubeRbacProxyRule

type KubeRbacProxyRule struct {
	pkg.RuleMeta
	pkg.StringRule
	// contains filtered or unexported fields
}

func NewKubeRbacProxyRule

func NewKubeRbacProxyRule(excludeRules []pkg.StringRuleExclude,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *KubeRbacProxyRule

func (*KubeRbacProxyRule) Check added in v0.2.0

func (r *KubeRbacProxyRule) Check(_ context.Context)

type MountPointsRule added in v0.1.89

type MountPointsRule struct {
	pkg.RuleMeta
	pkg.StringRule
	// contains filtered or unexported fields
}

func NewMountPointsRule added in v0.1.89

func NewMountPointsRule(excludeRules []pkg.StringRuleExclude, m pkg.Module, errorList *errors.LintRuleErrorsList) *MountPointsRule

func (*MountPointsRule) Check added in v0.2.0

func (r *MountPointsRule) Check(_ context.Context)

Check checks that every dir or file declared in mount-points.yaml is actually used as a volumeMount.mountPath in at least one pod controller template.

Direction: mount-points.yaml → templates.

Built-in excluded paths: /sys, /sys/fs/cgroup, /dev, /proc, /tmp — these Linux system paths are always available and do not need to be declared in mount-points.yaml.

Module-specific exclusions are configured via dmtlint.yaml:

templates:
  excludeRules:
    mount-points:
      - /host
      - /etc/multipath

type OpenAPIValuesQuoteRule added in v0.2.1

type OpenAPIValuesQuoteRule struct {
	pkg.RuleMeta
	pkg.StringRule
	// contains filtered or unexported fields
}

OpenAPIValuesQuoteRule flags template usages of module OpenAPI string values that have no validation pattern (no pattern/enum/format) and are rendered unquoted. Such values can contain characters that break YAML or silently change the parsed type, so they must be quoted in templates.

func NewOpenAPIValuesQuoteRule added in v0.2.1

func NewOpenAPIValuesQuoteRule(excludeRules []pkg.StringRuleExclude, m pkg.Module, errorList *errors.LintRuleErrorsList) *OpenAPIValuesQuoteRule

func (*OpenAPIValuesQuoteRule) Check added in v0.2.1

Check parses the module OpenAPI value schema, collects the pattern-less string paths, and reports every unquoted usage of them in templates.

type PDBRule

type PDBRule struct {
	pkg.RuleMeta
	pkg.KindRule
	// contains filtered or unexported fields
}

func NewPDBRule

func NewPDBRule(excludeRules []pkg.KindRuleExclude, m pkg.Module, errorList *errors.LintRuleErrorsList) *PDBRule

func (*PDBRule) Check added in v0.2.0

func (r *PDBRule) Check(_ context.Context)

Check adds linting errors if there are pods from controllers which are not covered (except DaemonSets) by a PodDisruptionBudget

type PodResourcePolicy

type PodResourcePolicy struct {
	// Per-container resource policies.
	// +optional
	// +patchMergeKey=containerName
	// +patchStrategy=merge
	ContainerPolicies []ContainerResourcePolicy `` /* 132-byte string literal not displayed */
}

PodResourcePolicy controls how autoscaler computes the recommended resources for containers belonging to the pod. There can be at most one entry for every named container and optionally a single wildcard entry with `containerName` = '*', which handles all containers that don't have individual policies.

type PodUpdatePolicy

type PodUpdatePolicy struct {
	// Controls when autoscaler applies changes to the pod resources.
	// The default is 'Auto'.
	// +optional
	UpdateMode *UpdateMode `json:"updateMode,omitempty" protobuf:"bytes,1,opt,name=updateMode"`
}

PodUpdatePolicy describes the rbac-proxy on how changes are applied to the pods.

type PrometheusRule

type PrometheusRule struct {
	pkg.RuleMeta
	pkg.BoolRule
	// contains filtered or unexported fields
}

func NewPrometheusRule

func NewPrometheusRule(cfg *pkg.TemplatesLinterConfig, m pkg.Module, errorList *errors.LintRuleErrorsList) *PrometheusRule

func (*PrometheusRule) Check added in v0.2.0

func (r *PrometheusRule) Check(_ context.Context)

type PromtoolRule added in v0.2.0

type PromtoolRule struct {
	pkg.RuleMeta
	pkg.BoolRule
	// contains filtered or unexported fields
}

PromtoolRule runs promtool against every rendered PrometheusRule object.

It is a separate rule from PrometheusRule — which validates the module's monitoring/ files — because the two run under different preconditions: the file checks only apply to modules that ship a monitoring/ directory, while promtool applies to any rendered PrometheusRule. Both report under the same rule ID, so findings are indistinguishable in the output.

func NewPromtoolRule added in v0.2.0

func NewPromtoolRule(cfg *pkg.TemplatesLinterConfig, m pkg.Module, errorList *errors.LintRuleErrorsList) *PromtoolRule

func (*PromtoolRule) Check added in v0.2.0

func (r *PromtoolRule) Check(_ context.Context)

type RecommendedContainerResources

type RecommendedContainerResources struct {
	// Name of the container.
	ContainerName string `json:"containerName,omitempty" protobuf:"bytes,1,opt,name=containerName"`
	// Recommended amount of resources. Observes ContainerResourcePolicy.
	Target v1.ResourceList `json:"target" protobuf:"bytes,2,rep,name=target,casttype=ResourceList,castkey=ResourceName"`
	// Minimum recommended amount of resources. Observes ContainerResourcePolicy.
	// This amount is not guaranteed to be sufficient for the application to operate in a stable way, however
	// running with less resources is likely to have significant impact on performance/availability.
	// +optional
	LowerBound v1.ResourceList `json:"lowerBound,omitempty" protobuf:"bytes,3,rep,name=lowerBound,casttype=ResourceList,castkey=ResourceName"`
	// Maximum recommended amount of resources. Observes ContainerResourcePolicy.
	// Any resources allocated beyond this value are likely wasted. This value may be larger than the maximum
	// amount of application is actually capable of consuming.
	// +optional
	UpperBound v1.ResourceList `json:"upperBound,omitempty" protobuf:"bytes,4,rep,name=upperBound,casttype=ResourceList,castkey=ResourceName"`
	// The most recent recommended resources target computed by the autoscaler
	// for the controlled pods, based only on actual resource usage, not taking
	// into account the ContainerResourcePolicy.
	// May differ from the Recommendation if the actual resource usage causes
	// the target to violate the ContainerResourcePolicy (lower than MinAllowed
	// or higher that MaxAllowed).
	// Used only as status indication, will not affect actual resource assignment.
	// +optional
	UncappedTarget v1.ResourceList `json:"uncappedTarget,omitempty" protobuf:"bytes,5,opt,name=uncappedTarget"`
}

RecommendedContainerResources is the recommendation of resources computed by autoscaler for a specific container. Respects the container resource policy if present in the spec. In particular the recommendation is not produced for containers with `ContainerScalingMode` set to 'Off'.

type RecommendedPodResources

type RecommendedPodResources struct {
	// Resources recommended by the autoscaler for each container.
	// +optional
	ContainerRecommendations []RecommendedContainerResources `json:"containerRecommendations,omitempty" protobuf:"bytes,1,rep,name=containerRecommendations"`
}

RecommendedPodResources is the recommendation of resources computed by autoscaler. It contains a recommendation for each container in the pod (except for those with `ContainerScalingMode` set to 'Off').

type RegistryRule added in v0.1.33

type RegistryRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewRegistryRule added in v0.1.33

func NewRegistryRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *RegistryRule

func (*RegistryRule) Check added in v0.2.0

func (r *RegistryRule) Check(_ context.Context)

Check checks module registry secret for the module.

type SchemaValidationRule added in v0.2.4

type SchemaValidationRule struct {
	pkg.RuleMeta
	pkg.KindRule
	// contains filtered or unexported fields
}

SchemaValidationRule decodes every rendered manifest into the Go type that serves it, strictly: a field of the wrong type and a field the API does not declare are both errors. The types come from the k8s.io/api version dmt is built against, so what the rule checks against is whatever Kubernetes release that is — there is no schema snapshot to keep in sync.

Only standard Kubernetes resources are checked. A custom resource has no Go type registered and is skipped, as is any other unregistered kind: the rule reports violations, never the absence of a type.

func NewSchemaValidationRule added in v0.2.4

func NewSchemaValidationRule(excludeRules []pkg.KindRuleExclude, m pkg.Module, errorList *errors.LintRuleErrorsList) *SchemaValidationRule

func (*SchemaValidationRule) Check added in v0.2.4

func (r *SchemaValidationRule) Check(_ context.Context)

type ServicePortRule

type ServicePortRule struct {
	pkg.RuleMeta
	pkg.ServicePortRule
	// contains filtered or unexported fields
}

func NewServicePortRule

func NewServicePortRule(excludeRules []pkg.ServicePortExclude,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *ServicePortRule

func (*ServicePortRule) Check added in v0.2.0

func (r *ServicePortRule) Check(_ context.Context)

type TargetRef

type TargetRef struct {
	Kind string
	Name string
}

type UpdateMode

type UpdateMode string

UpdateMode controls when autoscaler applies changes to the pod resoures. +kubebuilder:validation:Enum=Off;Initial;Recreate;Auto

const (
	// UpdateModeOff means that autoscaler never changes Pod resources.
	// The recommender still sets the recommended resources in the
	// VerticalPodAutoscaler object. This can be used for a "dry run".
	UpdateModeOff UpdateMode = "Off"
	// UpdateModeInitial means that autoscaler only assigns resources on pod
	// creation and does not change them during the lifetime of the pod.
	UpdateModeInitial UpdateMode = "Initial"
	// UpdateModeRecreate means that autoscaler assigns resources on pod
	// creation and additionally can update them during the lifetime of the
	// pod by deleting and recreating the pod.
	UpdateModeRecreate UpdateMode = "Recreate"
	// DEPRECATED since vpa version 1.5.1. It is now recommended to use InPlaceOrRecreate instead.
	// UpdateModeAuto means that autoscaler assigns resources on pod creation
	// and additionally can update them during the lifetime of the pod,
	// using any available update method. Currently this is equivalent to
	// Recreate, which is the only available update method.
	UpdateModeAuto UpdateMode = "Auto"
	// UpdateModeInPlaceOrReacreate means that autoscaler assigns resources on pod creation
	// if Kubernetes support is available, in-place resource updates are performed,
	// and if it is not available, a fallback to eviction is performed.
	UpdateModeInPlaceOrReacreate UpdateMode = "InPlaceOrRecreate"
)

type VPARule

type VPARule struct {
	pkg.RuleMeta
	pkg.KindRule
	// contains filtered or unexported fields
}

func NewVPARule

func NewVPARule(excludeRules []pkg.KindRuleExclude, m pkg.Module, errorList *errors.LintRuleErrorsList) *VPARule

func (*VPARule) Check added in v0.2.0

func (r *VPARule) Check(_ context.Context)

Check fills linting error regarding VPA

type VerticalPodAutoscaler

type VerticalPodAutoscaler struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Specification of the behavior of the autoscaler.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
	Spec VerticalPodAutoscalerSpec `json:"spec" protobuf:"bytes,2,name=spec"`

	// Current information about the autoscaler.
	// +optional
	Status VerticalPodAutoscalerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

VerticalPodAutoscaler is the configuration for a vertical pod autoscaler, which automatically manages pod resources based on historical and real time resource utilization.

type VerticalPodAutoscalerCheckpoint

type VerticalPodAutoscalerCheckpoint struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Specification of the checkpoint.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
	// +optional
	Spec VerticalPodAutoscalerCheckpointSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`

	// Data of the checkpoint.
	// +optional
	Status VerticalPodAutoscalerCheckpointStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

VerticalPodAutoscalerCheckpoint is the checkpoint of the internal state of VPA that is used for recovery after recommender's restart.

type VerticalPodAutoscalerCheckpointList

type VerticalPodAutoscalerCheckpointList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []VerticalPodAutoscalerCheckpoint `json:"items"`
}

VerticalPodAutoscalerCheckpointList is a list of VerticalPodAutoscalerCheckpoint objects.

type VerticalPodAutoscalerCheckpointSpec

type VerticalPodAutoscalerCheckpointSpec struct {
	// Name of the VPA object that stored VerticalPodAutoscalerCheckpoint object.
	VPAObjectName string `json:"vpaObjectName,omitempty" protobuf:"bytes,1,opt,name=vpaObjectName"`

	// Name of the checkpointed container.
	ContainerName string `json:"containerName,omitempty" protobuf:"bytes,2,opt,name=containerName"`
}

VerticalPodAutoscalerCheckpointSpec is the specification of the checkpoint object.

type VerticalPodAutoscalerCheckpointStatus

type VerticalPodAutoscalerCheckpointStatus struct {
	// The time when the status was last refreshed.
	// +nullable
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,1,opt,name=lastUpdateTime"`

	// Version of the format of the stored data.
	Version string `json:"version,omitempty" protobuf:"bytes,2,opt,name=version"`

	// Checkpoint of histogram for consumption of CPU.
	CPUHistogram HistogramCheckpoint `json:"cpuHistogram,omitempty" protobuf:"bytes,3,rep,name=cpuHistograms"`

	// Checkpoint of histogram for consumption of memory.
	MemoryHistogram HistogramCheckpoint `json:"memoryHistogram,omitempty" protobuf:"bytes,4,rep,name=memoryHistogram"`

	// Timestamp of the fist sample from the histograms.
	// +nullable
	FirstSampleStart metav1.Time `json:"firstSampleStart,omitempty" protobuf:"bytes,5,opt,name=firstSampleStart"`

	// Timestamp of the last sample from the histograms.
	// +nullable
	LastSampleStart metav1.Time `json:"lastSampleStart,omitempty" protobuf:"bytes,6,opt,name=lastSampleStart"`

	// Total number of samples in the histograms.
	TotalSamplesCount int `json:"totalSamplesCount,omitempty" protobuf:"bytes,7,opt,name=totalSamplesCount"`
}

VerticalPodAutoscalerCheckpointStatus contains data of the checkpoint.

type VerticalPodAutoscalerCondition

type VerticalPodAutoscalerCondition struct {
	// type describes the current condition
	Type VerticalPodAutoscalerConditionType `json:"type" protobuf:"bytes,1,name=type"`
	// status is the status of the condition (True, False, Unknown)
	Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,name=status"`
	// lastTransitionTime is the last time the condition transitioned from
	// one status to another
	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
	// reason is the reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
	// message is a human-readable explanation containing details about
	// the transition
	// +optional
	Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
}

VerticalPodAutoscalerCondition describes the state of a VerticalPodAutoscaler at a certain point.

type VerticalPodAutoscalerConditionType

type VerticalPodAutoscalerConditionType string

VerticalPodAutoscalerConditionType are the valid conditions of a VerticalPodAutoscaler.

var (
	// RecommendationProvided indicates whether the VPA recommender was able to calculate a recommendation.
	RecommendationProvided VerticalPodAutoscalerConditionType = "RecommendationProvided"
	// LowConfidence indicates whether the VPA recommender has low confidence in the recommendation for
	// some of containers.
	LowConfidence VerticalPodAutoscalerConditionType = "LowConfidence"
	// NoPodsMatched indicates that label selector used with VPA object didn't match any pods.
	NoPodsMatched VerticalPodAutoscalerConditionType = "NoPodsMatched"
	// FetchingHistory indicates that VPA recommender is in the process of loading additional history samples.
	FetchingHistory VerticalPodAutoscalerConditionType = "FetchingHistory"
	// ConfigDeprecated indicates that this VPA configuration is deprecated
	// and will stop being supported soon.
	ConfigDeprecated VerticalPodAutoscalerConditionType = "ConfigDeprecated"
	// ConfigUnsupported indicates that this VPA configuration is unsupported
	// and recommendations will not be provided for it.
	ConfigUnsupported VerticalPodAutoscalerConditionType = "ConfigUnsupported"
)

type VerticalPodAutoscalerList

type VerticalPodAutoscalerList struct {
	metav1.TypeMeta `json:",inline"`
	// metadata is the standard list metadata.
	// +optional
	metav1.ListMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`

	// items is the list of vertical pod autoscaler objects.
	Items []VerticalPodAutoscaler `json:"items" protobuf:"bytes,2,rep,name=items"`
}

VerticalPodAutoscalerList is a list of VerticalPodAutoscaler objects.

type VerticalPodAutoscalerSpec

type VerticalPodAutoscalerSpec struct {

	// TargetRef points to the controller managing the set of pods for the
	// autoscaler to control - e.g. Deployment, StatefulSet. VerticalPodAutoscaler
	// can be targeted at controller implementing scale subresource (the pod set is
	// retrieved from the controller's ScaleStatus) or some well known controllers
	// (e.g. for DaemonSet the pod set is read from the controller's spec).
	// If VerticalPodAutoscaler cannot use specified target it will report
	// ConfigUnsupported condition.
	// Note that VerticalPodAutoscaler does not require full implementation
	// of scale subresource - it will not use it to modify the replica count.
	// The only thing retrieved is a label selector matching pods grouped by
	// the target resource.
	TargetRef *autoscaling.CrossVersionObjectReference `json:"targetRef" protobuf:"bytes,1,name=targetRef"`

	// Describes the rbac-proxy on how changes are applied to the pods.
	// If not specified, all fields in the `PodUpdatePolicy` are set to their
	// default values.
	// +optional
	UpdatePolicy *PodUpdatePolicy `json:"updatePolicy,omitempty" protobuf:"bytes,2,opt,name=updatePolicy"`

	// Controls how the autoscaler computes recommended resources.
	// The resource policy may be used to set constraints on the recommendations
	// for individual containers. If not specified, the autoscaler computes recommended
	// resources for all containers in the pod, without additional constraints.
	// +optional
	ResourcePolicy *PodResourcePolicy `json:"resourcePolicy,omitempty" protobuf:"bytes,3,opt,name=resourcePolicy"`
}

VerticalPodAutoscalerSpec is the specification of the behavior of the autoscaler.

type VerticalPodAutoscalerStatus

type VerticalPodAutoscalerStatus struct {
	// The most recently computed amount of resources recommended by the
	// autoscaler for the controlled pods.
	// +optional
	Recommendation *RecommendedPodResources `json:"recommendation,omitempty" protobuf:"bytes,1,opt,name=recommendation"`

	// Conditions is the set of conditions required for this autoscaler to scale its target,
	// and indicates whether or not those conditions are met.
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []VerticalPodAutoscalerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"`
}

VerticalPodAutoscalerStatus describes the runtime state of the autoscaler.

type WebhookConfigurationRule added in v0.1.89

type WebhookConfigurationRule struct {
	pkg.RuleMeta
	pkg.KindRule
	// contains filtered or unexported fields
}

func NewWebhookConfigurationRule added in v0.1.89

func NewWebhookConfigurationRule(excludeRules []pkg.KindRuleExclude,
	m pkg.Module, errorList *errors.LintRuleErrorsList) *WebhookConfigurationRule

func (*WebhookConfigurationRule) Check added in v0.2.0

type WerfRule added in v0.1.19

type WerfRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewWerfRule added in v0.1.19

func NewWerfRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *WerfRule

func (*WerfRule) Check added in v0.2.0

func (r *WerfRule) Check(_ context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL