Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayContainsCaseInsensitive(arr []string, str string) bool
- func ConvertK8sUUIDtoNormal(k8sUUID string) string
- func ErrOnLocalOnlyIPAddr(addr string) error
- func GetUUIDFromProviderID(providerID string) string
- func NewKlogBridge() log.Logger
- 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) FindNodeInfo(UUID string) (*NodeInfo, error)
- func (nm *NodeManager) GetNode(UUID string, node *pb.Node) 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 cloudprovider.ControllerClientBuilder, stop <-chan struct{})
- func (vs *VSphere) Instances() (cloudprovider.Instances, bool)
- func (vs *VSphere) InstancesV2() (cloudprovider.InstancesV2, 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 ( // RegisteredProviderName is the name of the cloud provider registered with // Kubernetes. RegisteredProviderName string = "vsphere" // ProviderName is the name used for constructing Provider ID ProviderName string = "vsphere" // ClientName is the user agent passed into the controller client builder. ClientName string = "vsphere-cloud-controller-manager" )
const ( // ProviderPrefix is the Kubernetes cloud provider prefix for this // cloud provider. ProviderPrefix = ProviderName + "://" // MinUUIDLen is the min length for a valid UUID MinUUIDLen int = 36 )
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 ArrayContainsCaseInsensitive ¶ added in v1.22.3
ArrayContainsCaseInsensitive detects whether a given array of string contains the given string, ignoring case.
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 ErrOnLocalOnlyIPAddr ¶ added in v1.0.0
ErrOnLocalOnlyIPAddr returns an error if the provided IP address is accessible only on the VM's guest OS.
func GetUUIDFromProviderID ¶ added in v0.2.0
GetUUIDFromProviderID returns a UUID from the supplied cloud provider ID.
func NewKlogBridge ¶ added in v1.2.0
NewKlogBridge provides a vapi logger with klog backend
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) FindNodeInfo ¶ added in v1.1.0
func (nm *NodeManager) FindNodeInfo(UUID string) (*NodeInfo, error)
FindNodeInfo retrieves the NodeInfo from the tree
func (*NodeManager) GetNode ¶ added in v1.1.0
func (nm *NodeManager) GetNode(UUID string, node *pb.Node) error
GetNode gets the NodeInfo by UUID
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 cloudprovider.ControllerClientBuilder, stop <-chan struct{})
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) InstancesV2 ¶ added in v1.19.0
func (vs *VSphere) InstancesV2() (cloudprovider.InstancesV2, bool)
InstancesV2 returns an implementation of cloudprovider.InstancesV2.
TODO: implement this for v1.20
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.