Documentation ¶
Index ¶
- Constants
- Variables
- type Instances
- func (i *Instances) AddSSHKeyToAllInstances(user string, keyData []byte) error
- func (i *Instances) CurrentNodeName(hostname string) (string, error)
- func (i *Instances) ExternalID(name string) (string, error)
- func (i *Instances) InstanceID(name string) (string, error)
- func (i *Instances) InstanceType(name string) (string, error)
- func (i *Instances) List(filter string) ([]string, error)
- func (i *Instances) NodeAddresses(name string) ([]api.NodeAddress, error)
- type VSphere
- func (vs *VSphere) AttachDisk(vmDiskPath string, nodeName string) (diskID string, diskUUID string, err error)
- func (vs *VSphere) Clusters() (cloudprovider.Clusters, bool)
- func (vs *VSphere) CreateVolume(name string, size int, tags *map[string]string) (volumePath string, err error)
- func (vs *VSphere) DeleteVolume(vmDiskPath string) error
- func (vs *VSphere) DetachDisk(volPath string, nodeName string) error
- func (vs *VSphere) DiskIsAttached(volPath string, nodeName string) (bool, error)
- func (vs *VSphere) DisksAreAttached(volPaths []string, nodeName string) (map[string]bool, error)
- func (vs *VSphere) GetZone() (cloudprovider.Zone, error)
- func (vs *VSphere) Instances() (cloudprovider.Instances, bool)
- func (vs *VSphere) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (vs *VSphere) NodeExists(c *govmomi.Client, nodeName string) (bool, error)
- 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)
- type VSphereConfig
- type Volumes
Constants ¶
const ( ProviderName = "vsphere" ActivePowerState = "poweredOn" SCSIControllerType = "scsi" LSILogicControllerType = "lsiLogic" BusLogicControllerType = "busLogic" PVSCSIControllerType = "pvscsi" LSILogicSASControllerType = "lsiLogic-sas" SCSIControllerLimit = 4 SCSIControllerDeviceLimit = 15 SCSIDeviceSlots = 16 SCSIReservedSlot = 7 ThinDiskType = "thin" VolDir = "kubevols" )
Variables ¶
var ErrFileAlreadyExist = errors.New("File requested already exist")
var ErrNoDevicesFound = errors.New("No devices found")
var ErrNoDiskIDFound = errors.New("No vSphere disk ID found")
var ErrNoDiskUUIDFound = errors.New("No disk UUID found")
var ErrNonSupportedControllerType = errors.New("Disk is attached to non-supported controller type")
Functions ¶
This section is empty.
Types ¶
type Instances ¶
type Instances struct {
// contains filtered or unexported fields
}
func (*Instances) AddSSHKeyToAllInstances ¶
func (*Instances) CurrentNodeName ¶
func (*Instances) ExternalID ¶
ExternalID returns the cloud provider ID of the specified instance (deprecated).
func (*Instances) InstanceID ¶
InstanceID returns the cloud provider ID of the specified instance.
func (*Instances) List ¶
List returns names of VMs (inside vm folder) by applying filter and which are currently running.
func (*Instances) NodeAddresses ¶
func (i *Instances) NodeAddresses(name string) ([]api.NodeAddress, error)
NodeAddresses is an implementation of Instances.NodeAddresses.
type VSphere ¶
type VSphere struct {
// contains filtered or unexported fields
}
VSphere is an implementation of cloud provider Interface for VSphere.
func (*VSphere) AttachDisk ¶
func (vs *VSphere) AttachDisk(vmDiskPath string, nodeName string) (diskID string, diskUUID string, err error)
Attaches given virtual disk volume to the compute running kubelet.
func (*VSphere) CreateVolume ¶
func (vs *VSphere) CreateVolume(name string, size int, tags *map[string]string) (volumePath string, err error)
CreateVolume creates a volume of given size (in KiB).
func (*VSphere) DeleteVolume ¶
DeleteVolume deletes a volume given volume name.
func (*VSphere) DetachDisk ¶
DetachDisk detaches given virtual disk volume from the compute running kubelet.
func (*VSphere) DiskIsAttached ¶ added in v1.4.0
DiskIsAttached returns if disk is attached to the VM using controllers supported by the plugin.
func (*VSphere) DisksAreAttached ¶ added in v1.4.6
DisksAreAttached returns if disks are attached to the VM using controllers supported by the plugin.
func (*VSphere) Instances ¶
func (vs *VSphere) Instances() (cloudprovider.Instances, bool)
Instances returns an implementation of Instances for vSphere.
func (*VSphere) LoadBalancer ¶
func (vs *VSphere) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns an implementation of LoadBalancer for vSphere.
func (*VSphere) NodeExists ¶ added in v1.4.0
NodeExists checks if the node with given nodeName exist. Returns false if VM doesn't exist or VM is in powerOff state.
func (*VSphere) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*VSphere) Routes ¶
func (vs *VSphere) Routes() (cloudprovider.Routes, bool)
Routes returns a false since the interface is not supported for vSphere.
type VSphereConfig ¶
type VSphereConfig struct { Global struct { // vCenter username. User string `gcfg:"user"` // vCenter password in clear text. Password string `gcfg:"password"` // vCenter IP. VCenterIP string `gcfg:"server"` // vCenter port. VCenterPort string `gcfg:"port"` // True if vCenter uses self-signed cert. InsecureFlag bool `gcfg:"insecure-flag"` // Datacenter in which VMs are located. Datacenter string `gcfg:"datacenter"` // Datastore in which vmdks are stored. Datastore string `gcfg:"datastore"` // WorkingDir is path where VMs can be found. WorkingDir string `gcfg:"working-dir"` } Network struct { // PublicNetwork is name of the network the VMs are joined to. PublicNetwork string `gcfg:"public-network"` } Disk struct { // SCSIControllerType defines SCSI controller to be used. SCSIControllerType string `dcfg:"scsicontrollertype"` } }
type Volumes ¶ added in v1.4.0
type Volumes interface { // AttachDisk attaches given disk to given node. Current node // is used when nodeName is empty string. AttachDisk(vmDiskPath string, nodeName string) (diskID string, diskUUID string, err error) // DetachDisk detaches given disk to given node. Current node // is used when nodeName is empty string. // Assumption: If node doesn't exist, disk is already detached from node. DetachDisk(volPath string, nodeName string) error // DiskIsAttached checks if a disk is attached to the given node. // Assumption: If node doesn't exist, disk is not attached to the node. DiskIsAttached(volPath, nodeName string) (bool, error) // DisksAreAttached checks if a list disks are attached to the given node. // Assumption: If node doesn't exist, disks are not attached to the node. DisksAreAttached(volPath []string, nodeName string) (map[string]bool, error) // CreateVolume creates a new vmdk with specified parameters. CreateVolume(name string, size int, tags *map[string]string) (volumePath string, err error) // DeleteVolume deletes vmdk. DeleteVolume(vmDiskPath string) error }