vsphere

package
v1.22.4-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

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

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 ArrayContainsCaseInsensitive added in v1.22.3

func ArrayContainsCaseInsensitive(arr []string, str string) bool

ArrayContainsCaseInsensitive detects whether a given array of string contains the given string, ignoring case.

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 ErrOnLocalOnlyIPAddr added in v1.0.0

func ErrOnLocalOnlyIPAddr(addr string) error

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

func GetUUIDFromProviderID(providerID string) string

GetUUIDFromProviderID returns a UUID from the supplied cloud provider ID.

func NewKlogBridge added in v1.2.0

func NewKlogBridge() log.Logger

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

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) 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

func (vs *VSphere) HasClusterID() bool

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

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
Package route is a generated GoMock package.
Package route is a generated GoMock package.

Jump to

Keyboard shortcuts

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