Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertK8sUUIDtoNormal(k8sUUID string) string
- func GetUUIDFromProviderID(providerID string) string
- type DatacenterInfo
- type GRPCServer
- type NodeInfo
- type NodeManager
- func (nm *NodeManager) AddNodeInfoToVCList(vcenter string, datacenter string, node *NodeInfo)
- func (nm *NodeManager) DiscoverNode(nodeID string, searchBy cm.FindVM) error
- func (nm *NodeManager) ExportNodes(vcenter string, datacenter string, nodeList *[]*pb.Node) error
- func (nm *NodeManager) FindDatacenterInfoInVCList(vcenter string, datacenter string) (*DatacenterInfo, error)
- func (nm *NodeManager) FindNodeInfoInVCList(vcenter string, datacenter string, UUID string) (*NodeInfo, error)
- func (nm *NodeManager) RegisterNode(node *v1.Node)
- func (nm *NodeManager) UnregisterNode(node *v1.Node)
- type VCenterInfo
- type VSphere
- func (vs *VSphere) Clusters() (cloudprovider.Clusters, bool)
- func (vs *VSphere) HasClusterID() bool
- func (vs *VSphere) Initialize(clientBuilder controller.ControllerClientBuilder)
- func (vs *VSphere) Instances() (cloudprovider.Instances, bool)
- func (vs *VSphere) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (vs *VSphere) ProviderName() string
- func (vs *VSphere) Routes() (cloudprovider.Routes, bool)
- func (vs *VSphere) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)
- func (vs *VSphere) Zones() (cloudprovider.Zones, bool)
Constants ¶
const ( // ProviderPrefix is the Kubernetes cloud provider prefix for this // cloud provider. ProviderPrefix = "vsphere://" // MinUUIDLen is the min length for a valid UUID MinUUIDLen int = 36 )
const ( // ProviderName is the name of the cloud provider registered with // Kubernetes. ProviderName string = "vsphere" )
Variables ¶
var ( // ErrVCenterNotFound is returned when the configured vCenter cannot be // found. ErrVCenterNotFound = errors.New("vCenter not found") // ErrDatacenterNotFound is returned when the configured datacenter cannot // be found. ErrDatacenterNotFound = errors.New("Datacenter not found") // ErrVMNotFound is returned when the specified VM cannot be found. ErrVMNotFound = errors.New("VM not found") )
Errors
var ( // ErrNotFound is returned by NodeAddresses, NodeAddressesByProviderID, // and InstanceID when a node cannot be found. ErrNodeNotFound = errors.New("Node not found") )
Error constants
var GuestOSLookup = map[string]string{}/* 148 elements not displayed */
GuestOSLookup is a table for quick lookup between guestOsIdentifier and a shorthand name
Functions ¶
func ConvertK8sUUIDtoNormal ¶ added in v0.2.0
ConvertK8sUUIDtoNormal reformats UUID to match VMware's format:
Endian Safe : https://www.dmtf.org/standards/smbios/
8 - 4 - 4 - 4 - 12
K8s: 56492e42-22ad-3911-6d72-59cc8f26bc90 VMware: 422e4956-ad22-1139-6d72-59cc8f26bc90
func GetUUIDFromProviderID ¶ added in v0.2.0
GetUUIDFromProviderID returns a UUID from the supplied cloud provider ID.
Types ¶
type DatacenterInfo ¶
type DatacenterInfo struct {
// contains filtered or unexported fields
}
DatacenterInfo is information about a vCenter datascenter.
type GRPCServer ¶
type GRPCServer interface {
Start()
}
GRPCServer describes an object that can start a gRPC server.
type NodeInfo ¶
type NodeInfo struct { UUID string NodeName string NodeType string NodeAddresses []v1.NodeAddress // contains filtered or unexported fields }
NodeInfo is information about a Kubernetes node.
type NodeManager ¶
type NodeManager struct {
// contains filtered or unexported fields
}
NodeManager is used to manage Kubernetes nodes.
func (*NodeManager) AddNodeInfoToVCList ¶
func (nm *NodeManager) AddNodeInfoToVCList(vcenter string, datacenter string, node *NodeInfo)
AddNodeInfoToVCList creates a relational mapping from VC -> DC -> VM/Node
func (*NodeManager) DiscoverNode ¶
func (nm *NodeManager) DiscoverNode(nodeID string, searchBy cm.FindVM) error
DiscoverNode finds a node's VM using the specified search value and search type.
func (*NodeManager) ExportNodes ¶
ExportNodes transforms the NodeInfoList to []*pb.Node
func (*NodeManager) FindDatacenterInfoInVCList ¶
func (nm *NodeManager) FindDatacenterInfoInVCList(vcenter string, datacenter string) (*DatacenterInfo, error)
FindDatacenterInfoInVCList retrieves the DatacenterInfo from the tree
func (*NodeManager) FindNodeInfoInVCList ¶
func (nm *NodeManager) FindNodeInfoInVCList(vcenter string, datacenter string, UUID string) (*NodeInfo, error)
FindNodeInfoInVCList retrieves the NodeInfo from the tree
func (*NodeManager) RegisterNode ¶
func (nm *NodeManager) RegisterNode(node *v1.Node)
RegisterNode is the handler for when a node is added to a K8s cluster.
func (*NodeManager) UnregisterNode ¶
func (nm *NodeManager) UnregisterNode(node *v1.Node)
UnregisterNode is the handler for when a node is removed from a K8s cluster.
type VCenterInfo ¶
type VCenterInfo struct {
// contains filtered or unexported fields
}
VCenterInfo is information about a vCenter.
type VSphere ¶
type VSphere struct {
// contains filtered or unexported fields
}
VSphere is an implementation of cloud provider Interface for VSphere.
func (*VSphere) Clusters ¶
func (vs *VSphere) Clusters() (cloudprovider.Clusters, bool)
Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.
func (*VSphere) HasClusterID ¶
HasClusterID returns true if a ClusterID is required and set/
func (*VSphere) Initialize ¶
func (vs *VSphere) Initialize(clientBuilder controller.ControllerClientBuilder)
Initialize initializes the cloud provider.
func (*VSphere) Instances ¶
func (vs *VSphere) Instances() (cloudprovider.Instances, bool)
Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.
func (*VSphere) LoadBalancer ¶
func (vs *VSphere) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.
func (*VSphere) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*VSphere) Routes ¶
func (vs *VSphere) Routes() (cloudprovider.Routes, bool)
Routes returns a routes interface along with whether the interface is supported.