manager

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Overview

Package manager implements the controller manager for all controllers

Index

Constants

View Source
const DiagnosticsPort = 10256

DiagnosticsPort is the default port of the manager's diagnostics service listens on.

View Source
const HealthzPort = 10254

HealthzPort is the default port the manager's health service listens on. Changing this will result in a breaking change. Existing deployments may use the literal port number in their liveness and readiness probes, and upgrading to a controller version with a changed HealthzPort will result in crash loops until users update their probe config. Note that there are several stock manifests in this repo that also use the literal port number. If you update this value, search for the old port number and update the stock manifests also.

View Source
const MetricsPort = 10255

MetricsPort is the default port the manager's metrics service listens on. Similar to HealthzPort, it may be used in existing user deployment configurations, and its literal value is used in several stock manifests, which must be updated along with this value.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, c *Config, diagnostic util.ConfigDumpDiagnostic) error

Run starts the controller manager and blocks until it exits.

Types

type AutoHandler

type AutoHandler func(client.Client) bool

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

type Config

type Config struct {

	// Logging configurations
	LogLevel            string
	LogFormat           string
	LogReduceRedundancy bool

	// Kong high-level controller manager configurations
	KongAdminAPIConfig                adminapi.HTTPClientOpts
	KongAdminInitializationRetries    uint
	KongAdminInitializationRetryDelay time.Duration
	KongAdminToken                    string
	KongWorkspace                     string
	AnonymousReports                  bool
	EnableReverseSync                 bool
	SyncPeriod                        time.Duration
	SkipCACertificates                bool

	// Kong Proxy configurations
	APIServerHost            string
	APIServerQPS             int
	APIServerBurst           int
	MetricsAddr              string
	ProbeAddr                string
	KongAdminURL             string
	ProxySyncSeconds         float32
	ProxyTimeoutSeconds      float32
	KongCustomEntitiesSecret string

	// Kubernetes configurations
	KubeconfigPath          string
	IngressClassName        string
	EnableLeaderElection    bool
	LeaderElectionNamespace string
	LeaderElectionID        string
	Concurrency             int
	FilterTags              []string
	WatchNamespaces         []string

	// Ingress status
	PublishService       string
	PublishStatusAddress []string
	UpdateStatus         bool

	// Kubernetes API toggling
	IngressExtV1beta1Enabled bool
	IngressNetV1beta1Enabled bool
	IngressNetV1Enabled      bool
	IngressClassNetV1Enabled bool
	UDPIngressEnabled        bool
	TCPIngressEnabled        bool
	KongIngressEnabled       bool
	KnativeIngressEnabled    bool
	KongClusterPluginEnabled bool
	KongPluginEnabled        bool
	KongConsumerEnabled      bool
	ServiceEnabled           bool

	// Admission Webhook server config
	AdmissionServer admission.ServerConfig

	// Diagnostics and performance
	EnableProfiling     bool
	EnableConfigDumps   bool
	DumpSensitiveConfig bool

	// Feature Gates
	FeatureGates map[string]bool

	// TermDelay is the time.Duration which the controller manager will wait
	// after receiving SIGTERM or SIGINT before shutting down. This can be
	// helpful for advanced cases with load-balancers so that the ingress
	// controller can be gracefully removed/drained from their rotation.
	TermDelay time.Duration
}

Config collects all configuration that the controller manager takes from the environment.

func (*Config) FlagSet

func (c *Config) FlagSet() *pflag.FlagSet

FlagSet binds the provided Config to commandline flags.

func (*Config) GetKongClient

func (c *Config) GetKongClient(ctx context.Context) (*kong.Client, error)

func (*Config) GetKubeClient

func (c *Config) GetKubeClient() (client.Client, error)

func (*Config) GetKubeconfig

func (c *Config) GetKubeconfig() (*rest.Config, error)

type Controller

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

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

type ControllerDef

type ControllerDef struct {
	Enabled     bool
	AutoHandler AutoHandler
	Controller  Controller
}

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

func (*ControllerDef) MaybeSetupWithManager

func (c *ControllerDef) MaybeSetupWithManager(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 IngressAPI

type IngressAPI int
const (
	OtherAPI          IngressAPI = iota
	NetworkingV1      IngressAPI = iota
	NetworkingV1beta1 IngressAPI = iota
	ExtensionsV1beta1 IngressAPI = iota
)

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