k8sctrls

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(opts ManagerOptions) (*Manager, error)

func (*Manager) Setup

func (m *Manager) Setup(ctx context.Context, opts SetupOptions) ([]Reconciler, error)

func (*Manager) Start

func (m *Manager) Start(ctx context.Context, opts StartOptions) error

type ManagerOptions

type ManagerOptions struct {
	// IsReady observes whether the manager is ready,
	// the caller can leverage this symbol to be aware the manager's progress.
	IsReady *atomic.Bool
	// LeaderElection indicates whether to enable leader election.
	LeaderElection bool
	// LeaderLease indicates the duration of the lease that keeps the leadership.
	LeaderLease time.Duration
	// LeaderRenewTimeout indicates the timeout of renewing the leadership.
	LeaderRenewTimeout time.Duration
}

ManagerOptions holds the options for creating a new manager.

type ReconcileHelper

type ReconcileHelper interface {
	// GetLogger returns the logr.Logger.
	GetLogger() logr.Logger
	// GetConfig returns the rest.Config.
	GetConfig() *rest.Config
	// GetScheme returns the runtime.Schema.
	GetScheme() *runtime.Scheme
	// GetClient returns a client.Client configured with the rest.Config.
	// This client may not be a fully "direct" client -- it may read from a cache, for
	// instance.
	GetClient() client.Client
	// GetFieldIndexer returns a client.FieldIndexer configured with the client.
	GetFieldIndexer() client.FieldIndexer
	// GetCache returns the cache.Cache.
	GetCache() cache.Cache
	// GetEventRecorderFor returns a new record.EventRecorder for the provided name.
	GetEventRecorderFor(name string) record.EventRecorder
	// GetRESTMapper returns a meta.RESTMapper.
	GetRESTMapper() meta.RESTMapper
	// GetAPIReader returns a client.Reader that will be configured to use the API server.
	// This should be used sparingly and only when the client does not fit your
	// use case.
	GetAPIReader() client.Reader
}

type Reconciler

type Reconciler interface {
	Setup(mgr ctrl.Manager) error
}

type SetupOptions

type SetupOptions struct {
	ReconcileHelper

	ModelClient    *model.Client
	StorageManager *storage.Manager
}

SetupOptions holds the options for creating the controller.

type StartOptions

type StartOptions struct {
	// RestConfig indicates the rest config for connecting Kubernetes.
	RestConfig *rest.Config
	// SetupOptions holds the options for creating the Kubernetes controllers.
	SetupOptions SetupOptions
}

StartOptions holds the options for starting the manager.

Jump to

Keyboard shortcuts

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