instances

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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) InstanceExists added in v0.5.11

func (i *InstancesController) InstanceExists(ctx context.Context, node *v1.Node) (bool, error)

InstanceExists returns true if the instance for the given node exists according to the cloud provider. Use the node.name or node.spec.providerID field to find the node in the cloud provider.

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) InstanceMetadata added in v0.5.11

func (i *InstancesController) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)

InstanceMetadata returns the instance's metadata. The values returned in InstanceMetadata are translated into specific fields in the Node object on registration. Use the node.name or node.spec.providerID field to find the node in the cloud provider.

func (*InstancesController) InstanceShutdown added in v0.5.11

func (i *InstancesController) InstanceShutdown(ctx context.Context, node *v1.Node) (bool, error)

InstanceShutdown returns true if the instance is shutdown according to the cloud provider. Use the node.name or node.spec.providerID field to find the node in the cloud provider.

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.

Jump to

Keyboard shortcuts

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