manager

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GatewayClassControllerName is the name of the GatewayClass controller.
	GatewayClassControllerName = "GatewayClass"
	// GatewayControllerName is the name of the Gateway controller.
	GatewayControllerName = "Gateway"
	// ControlPlaneControllerName is the name of ControlPlane controller.
	ControlPlaneControllerName = "ControlPlane"
	// DataPlaneControllerName is the name of the DataPlane controller.
	DataPlaneControllerName = "DataPlane"
	// DataPlaneBlueGreenControllerName is the name of the DataPlaneBlueGreen controller.
	DataPlaneBlueGreenControllerName = "DataPlaneBlueGreen"
	// DataPlaneOwnedServiceFinalizerControllerName is the name of the DataPlaneOwnedServiceFinalizer controller.
	DataPlaneOwnedServiceFinalizerControllerName = "DataPlaneOwnedServiceFinalizer"
	// DataPlaneOwnedSecretFinalizerControllerName is the name of the DataPlaneOwnedSecretFinalizer controller.
	DataPlaneOwnedSecretFinalizerControllerName = "DataPlaneOwnedSecretFinalizer"
	// DataPlaneOwnedDeploymentFinalizerControllerName is the name of the DataPlaneOwnedDeploymentFinalizer controller.
	DataPlaneOwnedDeploymentFinalizerControllerName = "DataPlaneOwnedDeploymentFinalizer"
	// KonnectExtensionControllerName is the name of the KonnectExtension controller.
	KonnectExtensionControllerName = "KonnectExtension"
	// AIGatewayControllerName is the name of the AIGateway controller.
	AIGatewayControllerName = "AIGateway"
	// KongPluginInstallationControllerName is the name of the KongPluginInstallation controller.
	KongPluginInstallationControllerName = "KongPluginInstallation"
	// KonnectAPIAuthConfigurationControllerName is the name of the KonnectAPIAuthConfiguration controller.
	KonnectAPIAuthConfigurationControllerName = "KonnectAPIAuthConfiguration"
	// KonnectGatewayControlPlaneControllerName is the name of the KonnectGatewayControlPlane controller.
	KonnectGatewayControlPlaneControllerName = "KonnectGatewayControlPlane"
	// KongServiceControllerName is the name of the KongService controller.
	KongServiceControllerName = "KongService"
	// KongRouteControllerName is the name of the KongRoute controller.
	KongRouteControllerName = "KongRoute"
	// KongConsumerControllerName is the name of the KongConsumer controller.
	KongConsumerControllerName = "KongConsumer"
	// KongConsumerGroupControllerName is the name of the KongConsumerGroup controller.
	KongConsumerGroupControllerName = "KongConsumerGroup"
	// KongPluginBindingControllerName is the name of the KongPluginBinding controller.
	KongPluginBindingControllerName = "KongPluginBinding"
	// KongPluginControllerName is the name of the KongPlugin controller.
	KongPluginControllerName = "KongPlugin"
	// KongUpstreamControllerName is the name of the KongUpstream controller.
	KongUpstreamControllerName = "KongUpstream"
	// KongTargetControllerName is the name of the KongTarget controller.
	KongTargetControllerName = "KongTarget"
	// KongServicePluginBindingFinalizerControllerName is the name of the KongService PluginBinding finalizer controller.
	KongServicePluginBindingFinalizerControllerName = "KongServicePluginBindingFinalizer"
	// KongRoutePluginBindingFinalizerControllerName is the name of the KongRoute PluginBinding finalizer controller.
	KongRoutePluginBindingFinalizerControllerName = "KongRoutePluginBindingFinalizer"
	// KongConsumerPluginBindingFinalizerControllerName is the name of the KongConsumer PluginBinding finalizer controller.
	KongConsumerPluginBindingFinalizerControllerName = "KongConsumerPluginBindingFinalizer"
	// KongConsumerGroupPluginBindingFinalizerControllerName is the name of the KongConsumerGroup PluginBinding finalizer controller.
	KongConsumerGroupPluginBindingFinalizerControllerName = "KongConsumerGroupPluginBindingFinalizer"
	// KongCredentialsSecretControllerName is the name of the Credentials Secret controller.
	KongCredentialsSecretControllerName = "KongCredentialSecret"
	// KongCredentialBasicAuthControllerName is the name of the KongCredentialBasicAuth controller.
	KongCredentialBasicAuthControllerName = "KongCredentialBasicAuth" //nolint:gosec
	// KongCredentialAPIKeyControllerName is the name of the KongCredentialAPIKey controller.
	KongCredentialAPIKeyControllerName = "KongCredentialAPIKey" //nolint:gosec
	// KongCredentialACLControllerName is the name of the KongCredentialACL controller.
	KongCredentialACLControllerName = "KongCredentialACL" //nolint:gosec
	// KongCredentialHMACControllerName is the name of the KongCredentialHMAC controller.
	KongCredentialHMACControllerName = "KongCredentialHMAC" //nolint:gosec
	// KongCredentialJWTControllerName is the name of the KongCredentialJWT controller.
	KongCredentialJWTControllerName = "KongCredentialJWT" //nolint:gosec
	// KongCACertificateControllerName is the name of the KongCACertificate controller.
	KongCACertificateControllerName = "KongCACertificate"
	// KongCertificateControllerName is the name of the KongCertificate controller.
	KongCertificateControllerName = "KongCertificate"
	// KongVaultControllerName is the name of KongVault controller.
	KongVaultControllerName = "KongVault"
	// KongKeyControllerName is the name of KongKey controller.
	KongKeyControllerName = "KongKey"
	// KongKeySetControllerName is the name of KongKeySet controller.
	KongKeySetControllerName = "KongKeySet"
	// KongSNIControllerName is the name of KongSNI controller.
	KongSNIControllerName = "KongSNI"
	// KongDataPlaneClientCertificateControllerName is the name of KongDataPlaneClientCertificate controller.
	KongDataPlaneClientCertificateControllerName = "KongDataPlaneClientCertificate"
)

Variables

This section is empty.

Functions

func Run

func Run(
	cfg Config,
	scheme *runtime.Scheme,
	setupControllers SetupControllersFunc,
	admissionRequestHandler AdmissionRequestHandlerFunc,
	startedChan chan<- struct{},
	metadata metadata.Info,
) error

Run runs the manager. Parameter cfg represents the configuration for the manager that for normal operation is derived from command-line flags. The function setupControllers is expected to return a list of configured ControllerDef that will be added to the manager. The function admissionRequestHandler is used to construct the admission webhook handler for the validating webhook that is added to the manager too. Argument startedChan can be used as a signal to notify the caller when the manager has been started. Specifically, this channel gets closed when manager.Start() is called. Pass nil if you don't need this signal.

func SetupCacheIndicesForKonnectTypes added in v1.4.0

func SetupCacheIndicesForKonnectTypes(ctx context.Context, mgr manager.Manager, developmentMode bool) error

SetupCacheIndicesForKonnectTypes sets up the cache indices for the controllers. This is done only once because 1 manager's cache can only have one index with a predefined key and so that different controllers can share the same indices.

func SetupControllers

func SetupControllers(mgr manager.Manager, c *Config) (map[string]ControllerDef, error)

SetupControllers returns a list of ControllerDefs based on config.

Types

type AdmissionRequestHandlerFunc

type AdmissionRequestHandlerFunc func(c client.Client, l logr.Logger) *admission.RequestHandler

AdmissionRequestHandlerFunc is a function that returns an implementation of admission.RequestHandler, (validation webhook) it's passed to Run function and called later.

type AutoHandler

type AutoHandler func(client.Client) (bool, error)

AutoHandler decides whether the specific controller shall be enabled (true) or disabled (false).

type Config

type Config struct {
	MetricsAddr              string
	ProbeAddr                string
	WebhookCertDir           string
	WebhookPort              int
	LeaderElection           bool
	LeaderElectionNamespace  string
	DevelopmentMode          bool
	Out                      *os.File
	NewClientFunc            client.NewClientFunc
	ControllerName           string
	ControllerNamespace      string
	AnonymousReports         bool
	APIServerPath            string
	KubeconfigPath           string
	ClusterCASecretName      string
	ClusterCASecretNamespace string
	LoggerOpts               *zap.Options

	// controllers for standard APIs and features
	GatewayControllerEnabled            bool
	ControlPlaneControllerEnabled       bool
	DataPlaneControllerEnabled          bool
	DataPlaneBlueGreenControllerEnabled bool

	// Controllers for specialty APIs and experimental features.
	AIGatewayControllerEnabled              bool
	KongPluginInstallationControllerEnabled bool
	KonnectSyncPeriod                       time.Duration
	KonnectMaxConcurrentReconciles          uint

	// Controllers for Konnect APIs.
	KonnectControllersEnabled bool

	// webhook and validation options
	ValidatingWebhookEnabled           bool
	WebhookCertificateConfigBaseImage  string
	WebhookCertificateConfigShellImage string
}

Config represents the configuration for the manager.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a default configuration for the manager.

type Controller

type Controller interface {
	SetupWithManager(context.Context, ctrl.Manager) error
}

Controller is a Kubernetes controller that can be plugged into Manager.

type ControllerDef

type ControllerDef struct {
	Enabled    bool
	Controller Controller
}

ControllerDef is a specification of a Controller that can be conditionally registered with Manager.

func SetupControllersShim

func SetupControllersShim(mgr manager.Manager, c *Config) ([]ControllerDef, error)

SetupControllersShim runs SetupControllers and returns its result as a slice of the map values.

func (*ControllerDef) MaybeSetupWithManager

func (c *ControllerDef) MaybeSetupWithManager(ctx context.Context, mgr ctrl.Manager) error

MaybeSetupWithManager runs SetupWithManager on the controller if it is enabled and its AutoHandler (if any) indicates that it can load.

func (*ControllerDef) Name

func (c *ControllerDef) Name() string

Name returns a human-readable name of the controller.

type SetupControllersFunc

type SetupControllersFunc func(manager.Manager, *Config) ([]ControllerDef, error)

SetupControllersFunc represents function to setup controllers, which is called in Run function.

Directories

Path Synopsis
Package metadata includes metadata variables for logging and reporting.
Package metadata includes metadata variables for logging and reporting.

Jump to

Keyboard shortcuts

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