manager

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 68 Imported by: 1 module, 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 manager assembles the operator: the controllers and webhooks, in one controller-runtime manager. cmd/operator parses flags into Options.

Index

Constants

View Source
const (
	// CertsRotate: the operator creates and renews the certificate, and
	// injects its CA.
	CertsRotate = "rotate"
	// CertsExternal: the certificate files are provided in WebhookCertDir,
	// e.g. by cert-manager.
	CertsExternal = "external"
)

Certificate sources for the webhook (Options.WebhookCerts).

View Source
const DefaultEventsBufferBytes = controlplane.DefaultEventsBufferBytes

DefaultEventsBufferBytes bounds each replica's events buffer by default.

View Source
const DefaultSelectorRestartMaxDelay = 30 * time.Second

DefaultSelectorRestartMaxDelay bounds the random wait of each replica before it restarts with changed integration selectors.

View Source
const DefaultSigningKeyGrace = controller.DefaultRotationGrace

DefaultSigningKeyGrace is the least time each phase of a signing key rotation lasts by default: the kubelet's delay to update a mounted ConfigMap.

Variables

This section is empty.

Functions

func New

func New(cfg *rest.Config, o Options) (manager.Manager, error)

New creates the operator's manager: the bundle builder (leader only), the validating webhook (every replica), health probes and metrics.

func NewScheme

func NewScheme() (*runtime.Scheme, error)

NewScheme returns the types the operator reads and writes.

func Unwire

func Unwire(ctx context.Context, c client.Client, namespace, deployment string, logger *slog.Logger) error

Unwire runs at uninstall (the chart's pre-delete hook): it stops the operator, lets proxy pods start without the Pod webhook, and undoes the wiring, so the routes keep working, uninspected, once Inkwall is gone. WAFPolicy objects are kept, without the operator's finalizer, so deleting them (or their namespace) doesn't wait for an operator that is gone. Last, it deletes what the operator created for itself and the engines outside the chart: the trust ConfigMaps in the proxy namespaces, the bundle grant, the engine reports and the leader Lease. The bundle Secrets are kept.

Types

type Options

type Options struct {
	MetricsAddr string
	// MetricsSecure serves the metrics over HTTPS, only to clients whose
	// bearer token the API server authenticates (TokenReview) and allows
	// to get the /metrics non-resource URL (SubjectAccessReview).
	MetricsSecure bool
	// MetricsCertDir holds the metrics' tls.crt and tls.key (e.g. from
	// cert-manager), reloaded when they change; empty: a self-signed
	// certificate made when the operator starts.
	MetricsCertDir string
	ProbeAddr      string
	// Prober, if set, is the wiring's probe with its Key or Do set (tests);
	// nil: one that probes the pods with the bundle's key.
	Prober      *wiring.Prober
	LeaderElect bool
	// LeaseDuration and RenewDeadline tune leader election; 0: the
	// controller-runtime defaults (15s and 10s).
	LeaseDuration, RenewDeadline time.Duration
	// Namespace is the operator's, for its Lease and Secrets.
	Namespace string
	// Debounce batches changes before a bundle is built; 0: the default.
	Debounce time.Duration

	Webhooks       bool
	WebhookPort    int
	WebhookCertDir string
	// WebhookCerts is CertsRotate or CertsExternal.
	WebhookCerts   string
	WebhookService string
	WebhookSecret  string
	// WebhookDNSNames replaces the Services' names in the serving
	// certificate; for tests, where everything calls localhost.
	WebhookDNSNames []string

	// DistributionPort serves bundles to the engines (gRPC over TLS, with
	// the webhook's certificate); 0 disables.
	DistributionPort int
	// DistributionService is the Service engines reach it through, named in
	// the certificate.
	DistributionService string
	// Replica names this replica (its Pod; default: the host name), and
	// ReplicaUID, if set, makes its engine report go with the Pod.
	Replica    string
	ReplicaUID types.UID
	// EngineReportInterval is how often replicas publish their engines and
	// the leader updates Enforced; 0: 2s.
	EngineReportInterval time.Duration
	// SigningKeyGrace is the least time each phase of a signing key
	// rotation lasts; 0: DefaultSigningKeyGrace.
	SigningKeyGrace time.Duration

	// Inject adds the engine to proxy pods (needs Webhooks and
	// DistributionPort), with EngineImage unless InkwallConfig sets one.
	// Without it, the routes the operator wired are unwired.
	Inject           bool
	EngineImage      string
	EnginePullPolicy corev1.PullPolicy
	// EnginePullSecrets are the Secrets the Pod webhook's injected pods
	// pull the engine image with.
	EnginePullSecrets []string
	// Integrations select the proxy pods; nil: read from the InkwallConfig
	// when the manager is created. The operator restarts when they change
	// (its cache of proxy pods is built from them), or when an
	// integration's permissions are granted or revoked, after a random
	// delay up to SelectorRestartMaxDelay (0: DefaultSelectorRestartMaxDelay).
	Integrations            *integrations.Selectors
	SelectorRestartMaxDelay time.Duration
	// ProxyNamespaces are the only namespaces where the integrations'
	// selectors select pods (nil: every namespace): only their pods get
	// the engine and read access to the bundle.
	ProxyNamespaces integrations.Namespaces

	// Version is the operator's, sent to the optional control plane.
	Version string
	// ControlPlaneCAFile trusts the control plane's server certificate;
	// empty: the system roots.
	ControlPlaneCAFile string
	// CRDInterval is how often the leader looks for Traefik's IngressRoute
	// CRD, and Gateway API's, Envoy Gateway's and Istio's, until they are installed;
	// 0: 30s.
	CRDInterval time.Duration

	// EventsDir holds the replica's buffer of security events for the
	// control plane ("": in memory); EventsBufferBytes bounds it.
	EventsDir         string
	EventsBufferBytes int64

	// SkipControllerNameValidation lets a process create more than one
	// manager, which controller-runtime refuses by default (its
	// controllers' names must be unique in the process): for tests that
	// run again in the same process (go test -count). Never set in a
	// cluster.
	SkipControllerNameValidation bool
}

Options configures the operator.

Jump to

Keyboard shortcuts

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