Documentation ¶
Index ¶
- type InstancesController
- func (i *InstancesController) AddSSHKeyToAllInstances(_ context.Context, user string, keyData []byte) error
- func (i *InstancesController) CurrentNodeName(_ context.Context, nodeName string) (types.NodeName, error)
- func (i *InstancesController) InstanceExistsByProviderID(_ context.Context, providerID string) (bool, error)
- func (i *InstancesController) InstanceID(_ context.Context, nodeName types.NodeName) (string, error)
- func (i *InstancesController) InstanceShutdownByProviderID(_ context.Context, providerID string) (bool, error)
- func (i *InstancesController) InstanceType(_ context.Context, nodeName types.NodeName) (string, error)
- func (i *InstancesController) InstanceTypeByProviderID(_ context.Context, providerID string) (string, error)
- func (i *InstancesController) NodeAddresses(_ context.Context, name types.NodeName) ([]v1.NodeAddress, error)
- func (i *InstancesController) NodeAddressesByProviderID(_ context.Context, providerID string) ([]v1.NodeAddress, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstancesController ¶
type InstancesController struct { K8sClient clientset.Interface // contains filtered or unexported fields }
func New ¶
func New(client *metalgo.Driver, defaultExternalNetwork string) *InstancesController
New returns a new instance controller that satisfies the kubernetes cloud provider instances interface
func (*InstancesController) AddSSHKeyToAllInstances ¶
func (i *InstancesController) AddSSHKeyToAllInstances(_ context.Context, user string, keyData []byte) error
AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all machines. Expected format for the key is standard ssh-keygen format: <protocol> <blob>.
func (*InstancesController) CurrentNodeName ¶
func (i *InstancesController) CurrentNodeName(_ context.Context, nodeName string) (types.NodeName, error)
CurrentNodeName returns the name of the node we are currently running on. On most clouds (e.g. GCE) this is the hostname, so we provide the hostname.
func (*InstancesController) InstanceExistsByProviderID ¶
func (i *InstancesController) InstanceExistsByProviderID(_ context.Context, providerID string) (bool, error)
InstanceExistsByProviderID returns true if the instance for the given provider exists. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager. This method should still return true for machines that exist but are stopped/sleeping.
func (*InstancesController) InstanceID ¶
func (i *InstancesController) InstanceID(_ context.Context, nodeName types.NodeName) (string, error)
InstanceID returns the cloud provider ID of the node with the specified NodeName. Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound).
func (*InstancesController) InstanceShutdownByProviderID ¶
func (i *InstancesController) InstanceShutdownByProviderID(_ context.Context, providerID string) (bool, error)
InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider.
func (*InstancesController) InstanceType ¶
func (i *InstancesController) InstanceType(_ context.Context, nodeName types.NodeName) (string, error)
InstanceType returns the type of the specified instance.
func (*InstancesController) InstanceTypeByProviderID ¶
func (i *InstancesController) InstanceTypeByProviderID(_ context.Context, providerID string) (string, error)
InstanceTypeByProviderID returns the type of the specified instance.
func (*InstancesController) NodeAddresses ¶
func (i *InstancesController) NodeAddresses(_ context.Context, name types.NodeName) ([]v1.NodeAddress, error)
NodeAddresses returns the addresses of the specified instance.
func (*InstancesController) NodeAddressesByProviderID ¶
func (i *InstancesController) NodeAddressesByProviderID(_ context.Context, providerID string) ([]v1.NodeAddress, error)
NodeAddressesByProviderID returns the addresses of the specified instance. The instance is specified using the providerID of the node. The ProviderID is a unique identifier of the node. This will not be called from the node whose node addresses are being queried. m.e. local metadata services cannot be used in this method to obtain node addresses.