vsphere

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName is the name of the cloud provider registered with
	// Kubernetes.
	ProviderName string = "vsphere"
)
View Source
const (
	// ProviderPrefix is the Kubernetes cloud provider prefix for this
	// cloud provider.
	ProviderPrefix = "vsphere://"
)

Variables

View Source
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

View Source
var (
	// ErrNotFound is returned by NodeAddresses, NodeAddressesByProviderID,
	// and InstanceID when a node cannot be found.
	ErrNodeNotFound = errors.New("Node not found")
)

Error constants

View Source
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

func ConvertK8sUUIDtoNormal(k8sUUID string) string

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

func GetUUIDFromProviderID(providerID string) string

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

func (nm *NodeManager) ExportNodes(vcenter string, datacenter string, nodeList *[]*pb.Node) error

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

func (vs *VSphere) HasClusterID() bool

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

func (vs *VSphere) ProviderName() string

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.

func (*VSphere) ScrubDNS

func (vs *VSphere) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)

ScrubDNS is not implemented. TODO(akutz) Add better documentation for this function.

func (*VSphere) Zones

func (vs *VSphere) Zones() (cloudprovider.Zones, bool)

Zones returns a zones interface. Also returns true if the interface is supported, false otherwise.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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