Documentation
¶
Overview ¶
Package manager contains tools to create the CAPV controller manager.
Index ¶
- Constants
- func GetNetworkProvider(ctx context.Context, client client.Client, networkProvider string) (services.NetworkProvider, error)
- func InitializeWatch(controllerManagerContext *capvcontext.ControllerManagerContext, ...) (watch *fsnotify.Watcher, err error)
- func UpdateCredentials(opts *Options)
- type AddToManagerFunc
- type Manager
- type Options
Constants ¶
const ( // DefaultSyncPeriod is the default value for the eponymous // manager option. DefaultSyncPeriod = time.Minute * 10 // DefaultPodName is the default value for the eponymous manager option. DefaultPodName = defaultPrefix + "controller-manager" // DefaultPodNamespace is the default value for the manager namespace. DefaultPodNamespace = defaultPrefix + "system" // DefaultLeaderElectionID is the default value for the eponymous manager option. DefaultLeaderElectionID = DefaultPodName + "-runtime" )
const ( // NSXVPCNetworkProvider identifies the nsx-vpc network provider. NSXVPCNetworkProvider = "NSX-VPC" // NSXNetworkProvider identifies the NSX network provider. NSXNetworkProvider = "NSX" // VDSNetworkProvider identifies the VDS network provider. VDSNetworkProvider = "vsphere-network" // DummyLBNetworkProvider identifies the Dummy network provider. DummyLBNetworkProvider = "DummyLBNetworkProvider" )
Variables ¶
This section is empty.
Functions ¶
func GetNetworkProvider ¶ added in v1.1.0
func GetNetworkProvider(ctx context.Context, client client.Client, networkProvider string) (services.NetworkProvider, error)
GetNetworkProvider will return a network provider instance based on the environment the cfg is used to initialize a client that talks directly to api-server without using the cache.
func InitializeWatch ¶ added in v1.2.0
func InitializeWatch(controllerManagerContext *capvcontext.ControllerManagerContext, managerOpts *Options) (watch *fsnotify.Watcher, err error)
InitializeWatch adds a filesystem watcher for the capv credentials file. In case of any update to the credentials file, the new credentials are passed to the capv manager context.
func UpdateCredentials ¶ added in v1.2.0
func UpdateCredentials(opts *Options)
UpdateCredentials reads and updates credentials from the credentials file.
Types ¶
type AddToManagerFunc ¶
type AddToManagerFunc func(context.Context, *capvcontext.ControllerManagerContext, ctrlmgr.Manager) error
AddToManagerFunc is a function that can be optionally specified with the manager's Options in order to explicitly decide what controllers and webhooks to add to the manager.
type Manager ¶
type Manager interface {
ctrl.Manager
// GetControllerManagerContext returns the controller manager's context.
GetControllerManagerContext() *capvcontext.ControllerManagerContext
}
Manager is a CAPV controller manager.
type Options ¶
type Options struct {
ctrlmgr.Options
// PodNamespace is the namespace in which the pod running the controller
// maintains a leader election lock.
//
// Defaults to the eponymous constant in this package.
PodNamespace string
// PodName is the name of the pod running the controller manager.
//
// Defaults to the eponymous constant in this package.
PodName string
// Username is the username for the account used to access remote vSphere
// endpoints.
Username string
// Password is the password for the account used to access remote vSphere
// endpoints.
Password string
// CredentialsFile is the file that contains credentials of CAPV
CredentialsFile string
KubeConfig *rest.Config
// AddToManager is a function that can be optionally specified with
// the manager's Options in order to explicitly decide what controllers
// and webhooks to add to the manager.
AddToManager AddToManagerFunc
// NetworkProvider is the network provider used by Supervisor based clusters.
// If not set, it will default to a DummyNetworkProvider which is intended for testing purposes.
// VIM based clusters and managers will not need to set this flag.
NetworkProvider string
// WatchFilterValue is used to filter incoming objects by label.
//
// Defaults to the empty string and by that not filter anything.
WatchFilterValue string
}
Options describes the options used to create a new CAPV manager.