Documentation
¶
Overview ¶
Package manager implements the controller manager for all controllers
Index ¶
- func AdminAPIClientFromServiceDiscovery(ctx context.Context, logger logr.Logger, ...) ([]*adminapi.Client, error)
- type AdminAPIClientFactory
- type AdminAPIsDiscoverer
- type Controller
- type ControllerDef
- type GatewayClientsProvider
- type InstanceID
- type Manager
- func (m *Manager) DiagnosticsHandler() http.Handler
- func (m *Manager) GetClientsManager() *clients.AdminAPIClientsManager
- func (m *Manager) GetKubeconfig() *rest.Config
- func (m *Manager) IsReady() error
- func (m *Manager) KongValidator() admission.KongHTTPValidator
- func (m *Manager) Run(ctx context.Context) error
- type SchemaServiceGetter
- type TypeMetaSettingClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminAPIClientFromServiceDiscovery ¶
func AdminAPIClientFromServiceDiscovery( ctx context.Context, logger logr.Logger, kongAdminSvcNN k8stypes.NamespacedName, kubeClient client.Client, discoverer AdminAPIsDiscoverer, factory AdminAPIClientFactory, retryOpts ...retry.Option, ) ([]*adminapi.Client, error)
Types ¶
type AdminAPIClientFactory ¶
type AdminAPIsDiscoverer ¶
type Controller ¶
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 (*ControllerDef) MaybeSetupWithManager ¶
func (c *ControllerDef) MaybeSetupWithManager(mgr ctrl.Manager) error
MaybeSetupWithManager runs SetupWithManager on the controller if it is enabled.
func (*ControllerDef) Name ¶
func (c *ControllerDef) Name() string
Name returns a human-readable name of the controller.
type GatewayClientsProvider ¶
GatewayClientsProvider is an interface that provides clients for the currently discovered Gateway instances.
type InstanceID ¶
type InstanceID interface {
String() string
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, instanceID InstanceID, c managercfg.Config, logger logr.Logger, ) (*Manager, error)
New configures the controller manager call Start.
func (*Manager) DiagnosticsHandler ¶
DiagnosticsHandler returns the diagnostics HTTP handler if it's enabled in the configuration. Otherwise, it returns nil.
func (*Manager) GetClientsManager ¶
func (m *Manager) GetClientsManager() *clients.AdminAPIClientsManager
GetClientsManager returns the AdminAPIClientsManager used by the manager. TODO: It is used by telemetry to calculate kongVersion, DB mode and router flavor. It shouldn't be exposed so wide, only relevant stuff.
func (*Manager) GetKubeconfig ¶
GetKubeconfig returns the Kubernetes client configuration used by the manager.
func (*Manager) IsReady ¶
IsReady checks if the controller manager is ready to manage resources. It's only valid to call this method after the controller manager has been started with method Run(ctx).
func (*Manager) KongValidator ¶
func (m *Manager) KongValidator() admission.KongHTTPValidator
type SchemaServiceGetter ¶
type SchemaServiceGetter struct {
// contains filtered or unexported fields
}
SchemaServiceGetter returns schema service of an admin API client if there is any client available.
func NewSchemaServiceGetter ¶
func NewSchemaServiceGetter(cm GatewayClientsProvider) SchemaServiceGetter
NewSchemaServiceGetter creates a schema service getter that uses given client manager to maintain admin API clients.
func (SchemaServiceGetter) GetSchemaService ¶
func (ssg SchemaServiceGetter) GetSchemaService() kong.AbstractSchemaService
GetSchemaService returns the schema service for admin API client. It uses the configured clients manager to get the clients and then it uses one of those to obtain the service.
type TypeMetaSettingClient ¶
TypeMetaSettingClient decorates client.Client so that it populates the TypeMeta field of the object after fetching it from the API server.
func NewTypeMetaSettingClient ¶
func NewTypeMetaSettingClient(c client.Client) TypeMetaSettingClient