controller

package
v0.7.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 57 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package controller holds the operator's reconcilers.

Index

Constants

View Source
const (
	// DefaultDebounce batches changes: a GitOps sync of many objects
	// produces one bundle, not one per object.
	DefaultDebounce = time.Second

	// DefaultRotationGrace is the least time each phase of a key rotation
	// lasts: the kubelet updates a mounted ConfigMap within a minute or two.
	DefaultRotationGrace = time.Minute
	// DefaultEngineStale is the distribution Reporter's default Stale.
	DefaultEngineStale = 30 * time.Second
)

Defaults of the builder.

View Source
const (
	// ReasonBundleTooLarge: Accepted is False because the bundle with the
	// policy as it is now doesn't fit its Secrets, so it isn't published:
	// it keeps its previous version, or is left out (fit.go).
	ReasonBundleTooLarge = resolver.ReasonBundleTooLarge
	// ReasonSuspended and ReasonNotSuspended: the InkwallConfig's
	// Suspended condition.
	ReasonSuspended    = "Suspended"
	ReasonNotSuspended = "NotSuspended"
)

Reasons the builder reports.

View Source
const (
	ReasonRotationIdle       = "Idle"
	ReasonRotationPublishing = "Publishing"
	ReasonRotationRetiring   = "Retiring"
)

Reasons of the InkwallConfig's SigningKeyRotation condition: the phase.

View Source
const ReasonGeoStale = "Stale"

ReasonGeoStale is GeoDatabaseReady's reason for a table whose database is older than 30 days.

Variables

View Source
var HTTPRouteGVK = schema.GroupVersionKind{Group: gatewayv1.GroupName, Version: "v1", Kind: "HTTPRoute"}

HTTPRouteGVK is Gateway API's HTTPRoute, whose CRD may be missing.

Functions

func HTTPRoutes added in v0.3.0

func HTTPRoutes(ctx context.Context, c client.Client) ([]gatewayv1.HTTPRoute, error)

HTTPRoutes lists Gateway API's HTTPRoutes; none when their CRD isn't installed.

Types

type BundleReconciler

type BundleReconciler struct {
	Client client.Client
	// APIReader reads uncached, for the current bundle.
	APIReader client.Reader
	// Namespace is the operator's, where the bundle Secrets are.
	Namespace string
	Debounce  time.Duration
	Now       func() time.Time
	// EngineStale is how old a replica's engine report may be (the
	// distribution Reporter's Stale); a new leader waits this long before
	// a key rotation trusts the reports to list every engine. 0:
	// DefaultEngineStale.
	EngineStale time.Duration
	// RotationGrace is the least time each phase of a key rotation lasts;
	// 0: DefaultRotationGrace.
	RotationGrace time.Duration
	// IngressRoutes watches Traefik's IngressRoutes once their CRD is
	// installed; nil: they are only read at each build.
	IngressRoutes *crdwatch.Kind
	// HTTPRoutes watches Gateway API's HTTPRoutes once their CRD is
	// installed; nil: they are only read at each build.
	HTTPRoutes *crdwatch.Kind
	// VirtualServices watches Istio's VirtualServices once their CRD is
	// installed; nil: they are only read at each build.
	VirtualServices *crdwatch.Kind

	// Recorder records a Warning Event on an InkwallConfig whose
	// denyResponse the engine can't compile; nil: none.
	Recorder events.EventRecorder
	// contains filtered or unexported fields
}

BundleReconciler builds the cluster's bundle from its WAF objects and reports each object's Accepted condition. It runs on the leader only.

func (*BundleReconciler) Reconcile

Reconcile rebuilds the bundle.

func (*BundleReconciler) SetupWithManager

func (r *BundleReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager registers the builder with mgr.

type GeoReconciler

type GeoReconciler struct {
	Client client.Client
	// APIReader reads uncached: the stored table, the published bundle and
	// the source Secret.
	APIReader client.Reader
	// Namespace is the operator's, where the geo Secrets are.
	Namespace string
	// Root is where database files are: spec.geo.database.file names a
	// path under geo.FileRoot, which is Root in the operator's pod (the
	// default) and a directory of their own in tests.
	Root string
	Now  func() time.Time
	// contains filtered or unexported fields
}

GeoReconciler compiles the InkwallConfig's country database into a country table, stores it in its Secrets, and reports GeoDatabaseReady and status.geo. It runs on the leader only. The bundle builder names the stored table in the bundle once a policy uses spec.geo and the InkwallConfig sets spec.geo: the table is always written before the bundle that names it.

func (*GeoReconciler) Reconcile

Reconcile refreshes the country table from the configured database.

func (*GeoReconciler) SetupWithManager

func (r *GeoReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager registers the reconciler with mgr.

Jump to

Keyboard shortcuts

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