controlplane_extensions

package
v1.6.1-0...-486f9dc Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// GatewayOperatorControlPlaneNameManagingPluginsLabel is the label set on
	// Services to indicate that the ControlPlane is managing plugins for the
	// Service.
	GatewayOperatorControlPlaneNameManagingPluginsLabel = consts.OperatorLabelPrefix + "control-plane-managing-plugins-name"

	// GatewayOperatorControlPlaneNamespaceManagingPluginsLabel is the label set on
	// Services to indicate that the ControlPlane's namespace that is managing plugins
	// for the Service.
	GatewayOperatorControlPlaneNamespaceManagingPluginsLabel = consts.OperatorLabelPrefix + "control-plane-managing-plugins-namespace"

	// GatewayOperatorControlPlaneManagedPluginsAnnotation is the annotationset on
	// Services to indicate which plugins attached to this Service are managed
	// by the ControlPlane.
	// The annotation value is set to a comma separated list of KongPlugin names
	// that are managed by the ControlPlane.
	GatewayOperatorControlPlaneManagedPluginsAnnotation = consts.OperatorAnnotationPrefix + "control-plane-managed-plugins"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlPlaneDataPlanePluginsSpecChangedPredicate

type ControlPlaneDataPlanePluginsSpecChangedPredicate struct {
	predicate.Funcs
}

ControlPlaneDataPlanePluginsSpecChangedPredicate is a predicate that checks if the ControlPlane's DataPlane metrics extensions have changed.

func (ControlPlaneDataPlanePluginsSpecChangedPredicate) Create

Create returns true if at least one DataPlane metrics extensions is set on the ControlPlane.

func (ControlPlaneDataPlanePluginsSpecChangedPredicate) Delete

Delete returns true if the ControlPlane's DataPlanePluginOptions is set.

func (ControlPlaneDataPlanePluginsSpecChangedPredicate) Update

Update returns true if the ControlPlane's DataPlane metrics extensions have changed.

type PrometheusPluginConfig

type PrometheusPluginConfig struct {
	Latency        bool `json:"latency_metrics"`
	Bandwidth      bool `json:"bandwidth_metrics"`
	UpstreamHealth bool `json:"upstream_health_metrics"`
	StatusCode     bool `json:"status_code_metrics"`
}

PrometheusPluginConfig holds the configuration for the Prometheus plugin.

Ref: https://docs.konghq.com/hub/kong-inc/prometheus/configuration/.

type Reconciler

type Reconciler struct {
	client.Client
	CacheSyncTimeout                time.Duration
	LoggingMode                     osslogging.Mode
	DataPlaneScraperManagerNotifier ScrapeUpdateNotifier
}

Reconciler reconciles ControlPlane plugins as specified in ControlPlane's spec.controlPlaneOptions.dataplanePlugins field. It ensures that the KongPlugin instances are created and their configuration is up to date. It also ensures that the Services that have their plugins managed by the ControlPlane have the correct annotation set.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile moves the current state of an object to the intended state.

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(_ context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ScrapeUpdateNotifier

type ScrapeUpdateNotifier interface {
	NotifyAdd(ctx context.Context, cp *gwtypes.ControlPlane)
	NotifyRemove(ctx context.Context, cp types.NamespacedName)
}

ScrapeUpdateNotifier is an interface for notifying the scrapers manager about the need to add or remove a scraper for a DataPlane associated with the provided ControlPlane.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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