Documentation ¶
Overview ¶
This version of Photon cloud provider supports the disk interface for Photon persistent disk volume plugin. LoadBalancer, Routes, and Zones are currently not supported. The use of Photon cloud provider requires to start kubelet, kube-apiserver, and kube-controller-manager with config flag: '--cloud-provider=photon --cloud-config=[path_to_config_file]'. When running multi-node kubernetes using docker, the config file should be located inside /etc/kubernetes.
Index ¶
- Constants
- type Disks
- type PCCloud
- func (pc *PCCloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error
- func (pc *PCCloud) AttachDisk(ctx context.Context, pdID string, nodeName k8stypes.NodeName) error
- func (pc *PCCloud) Clusters() (cloudprovider.Clusters, bool)
- func (pc *PCCloud) CreateDisk(volumeOptions *VolumeOptions) (pdID string, err error)
- func (pc *PCCloud) CurrentNodeName(ctx context.Context, hostname string) (k8stypes.NodeName, error)
- func (pc *PCCloud) DeleteDisk(pdID string) error
- func (pc *PCCloud) DetachDisk(ctx context.Context, pdID string, nodeName k8stypes.NodeName) error
- func (pc *PCCloud) DiskIsAttached(ctx context.Context, pdID string, nodeName k8stypes.NodeName) (bool, error)
- func (pc *PCCloud) DisksAreAttached(ctx context.Context, pdIDs []string, nodeName k8stypes.NodeName) (map[string]bool, error)
- func (pc *PCCloud) GetZone(ctx context.Context) (cloudprovider.Zone, error)
- func (pc *PCCloud) GetZoneByNodeName(ctx context.Context, nodeName k8stypes.NodeName) (cloudprovider.Zone, error)
- func (pc *PCCloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
- func (pc *PCCloud) HasClusterID() bool
- func (pc *PCCloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
- func (pc *PCCloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)
- func (pc *PCCloud) InstanceID(ctx context.Context, nodeName k8stypes.NodeName) (string, error)
- func (pc *PCCloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
- func (pc *PCCloud) InstanceType(ctx context.Context, nodeName k8stypes.NodeName) (string, error)
- func (pc *PCCloud) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)
- func (pc *PCCloud) Instances() (cloudprovider.Instances, bool)
- func (pc *PCCloud) List(filter string) ([]k8stypes.NodeName, error)
- func (pc *PCCloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (pc *PCCloud) NodeAddresses(ctx context.Context, nodeName k8stypes.NodeName) ([]v1.NodeAddress, error)
- func (pc *PCCloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
- func (pc *PCCloud) ProviderName() string
- func (pc *PCCloud) Routes() (cloudprovider.Routes, bool)
- func (pc *PCCloud) Zones() (cloudprovider.Zones, bool)
- type PCConfig
- type VolumeOptions
Constants ¶
const ( ProviderName = "photon" DiskSpecKind = "persistent-disk" MAC_OUI_VC = "00:50:56" MAC_OUI_ESX = "00:0c:29" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Disks ¶
type Disks interface { // AttachDisk attaches given disk to given node. Current node // is used when nodeName is empty string. AttachDisk(ctx context.Context, pdID string, nodeName k8stypes.NodeName) error // DetachDisk detaches given disk to given node. Current node // is used when nodeName is empty string. DetachDisk(ctx context.Context, pdID string, nodeName k8stypes.NodeName) error // DiskIsAttached checks if a disk is attached to the given node. DiskIsAttached(ctx context.Context, pdID string, nodeName k8stypes.NodeName) (bool, error) // DisksAreAttached is a batch function to check if a list of disks are attached // to the node with the specified NodeName. DisksAreAttached(ctx context.Context, pdIDs []string, nodeName k8stypes.NodeName) (map[string]bool, error) // CreateDisk creates a new PD with given properties. CreateDisk(volumeOptions *VolumeOptions) (pdID string, err error) // DeleteDisk deletes PD. DeleteDisk(pdID string) error }
Disks is interface for manipulation with PhotonController Persistent Disks.
type PCCloud ¶
type PCCloud struct { cloudprovider.Zone // contains filtered or unexported fields }
Photon is an implementation of the cloud provider interface for Photon Controller.
func (*PCCloud) AddSSHKeyToAllInstances ¶
func (*PCCloud) AttachDisk ¶
Attaches given virtual disk volume to the compute running kubelet.
func (*PCCloud) CreateDisk ¶
func (pc *PCCloud) CreateDisk(volumeOptions *VolumeOptions) (pdID string, err error)
Create a volume of given size (in GB).
func (*PCCloud) CurrentNodeName ¶
func (*PCCloud) DeleteDisk ¶
Deletes a volume given volume name.
func (*PCCloud) DetachDisk ¶
Detaches given virtual disk volume from the compute running kubelet.
func (*PCCloud) DiskIsAttached ¶
func (pc *PCCloud) DiskIsAttached(ctx context.Context, pdID string, nodeName k8stypes.NodeName) (bool, error)
DiskIsAttached returns if disk is attached to the VM using controllers supported by the plugin.
func (*PCCloud) DisksAreAttached ¶
func (pc *PCCloud) DisksAreAttached(ctx context.Context, pdIDs []string, nodeName k8stypes.NodeName) (map[string]bool, error)
DisksAreAttached returns if disks are attached to the VM using controllers supported by the plugin.
func (*PCCloud) GetZoneByNodeName ¶
func (pc *PCCloud) GetZoneByNodeName(ctx context.Context, nodeName k8stypes.NodeName) (cloudprovider.Zone, error)
GetZoneByNodeName implements Zones.GetZoneByNodeName This is particularly useful in external cloud providers where the kubelet does not initialize node data.
func (*PCCloud) GetZoneByProviderID ¶
func (pc *PCCloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
GetZoneByProviderID implements Zones.GetZoneByProviderID This is particularly useful in external cloud providers where the kubelet does not initialize node data.
func (*PCCloud) HasClusterID ¶
HasClusterID returns true if the cluster has a clusterID
func (*PCCloud) Initialize ¶
func (pc *PCCloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func (*PCCloud) InstanceExistsByProviderID ¶
InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func (*PCCloud) InstanceID ¶
InstanceID returns the cloud provider ID of the specified instance.
func (*PCCloud) InstanceShutdownByProviderID ¶
func (pc *PCCloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
InstanceShutdownByProviderID returns true if the instance is in safe state to detach volumes
func (*PCCloud) InstanceType ¶
func (*PCCloud) InstanceTypeByProviderID ¶
InstanceTypeByProviderID returns the cloudprovider instance type of the node with the specified unique providerID This method will not be called from the node that is requesting this ID. i.e. metadata service and other local methods cannot be used here
func (*PCCloud) Instances ¶
func (pc *PCCloud) Instances() (cloudprovider.Instances, bool)
Instances returns an implementation of Instances for Photon Controller.
func (*PCCloud) LoadBalancer ¶
func (pc *PCCloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns an implementation of LoadBalancer for Photon Controller.
func (*PCCloud) NodeAddresses ¶
func (pc *PCCloud) NodeAddresses(ctx context.Context, nodeName k8stypes.NodeName) ([]v1.NodeAddress, error)
NodeAddresses is an implementation of Instances.NodeAddresses.
func (*PCCloud) NodeAddressesByProviderID ¶
func (pc *PCCloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
NodeAddressesByProviderID returns the node addresses of an instances with the specified unique providerID This method will not be called from the node that is requesting this ID. i.e. metadata service and other local methods cannot be used here
func (*PCCloud) ProviderName ¶
ProviderName returns the cloud provider ID.
type PCConfig ¶
type PCConfig struct { Global struct { // the Photon Controller endpoint IP address CloudTarget string `gcfg:"target"` // Photon Controller project name Project string `gcfg:"project"` // when kubelet is started with '--hostname-override=${IP_ADDRESS}', set to true; // otherwise, set to false. OverrideIP bool `gcfg:"overrideIP"` // VM ID for this node VMID string `gcfg:"vmID"` // Authentication enabled or not AuthEnabled bool `gcfg:"authentication"` } }