tencentcloud

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CloudInstanceNotFound = errors.New("tencentcloud instance not found")
)

Functions

func NewCloud

func NewCloud(config io.Reader) (cloudprovider.Interface, error)

Types

type Cloud

type Cloud struct {
	// contains filtered or unexported fields
}

func (*Cloud) AddSSHKeyToAllInstances

func (cloud *Cloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error

AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances expected format for the key is standard ssh-keygen format: <protocol> <blob>

func (*Cloud) Clusters

func (cloud *Cloud) Clusters() (cloudprovider.Clusters, bool)

Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.

func (*Cloud) CreateRoute

func (cloud *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint string, route *cloudprovider.Route) error

CreateRoute creates the described managed route route.Name will be ignored, although the cloud-provider may use nameHint to create a more user-meaningful name.

func (*Cloud) CurrentNodeName

func (cloud *Cloud) CurrentNodeName(ctx context.Context, hostname 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 (*Cloud) DeleteRoute

func (cloud *Cloud) DeleteRoute(ctx context.Context, clusterName string, route *cloudprovider.Route) error

DeleteRoute deletes the specified managed route Route should be as returned by ListRoutes

func (*Cloud) ExternalID

func (cloud *Cloud) ExternalID(ctx context.Context, nodeName types.NodeName) (string, error)

ExternalID 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 (*Cloud) HasClusterID

func (cloud *Cloud) HasClusterID() bool

HasClusterID returns true if a ClusterID is required and set

func (*Cloud) Initialize

func (cloud *Cloud) Initialize(clientBuilder controller.ControllerClientBuilder)

Initialize provides the cloud with a kubernetes client builder and may spawn goroutines to perform housekeeping activities within the cloud provider.

func (*Cloud) InstanceExistsByProviderID

func (cloud *Cloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)

InstanceExistsByProviderID returns true if the instance for the given provider id still is running. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.

func (*Cloud) InstanceID

func (cloud *Cloud) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error)

InstanceID returns the cloud provider ID of the node with the specified NodeName.

func (*Cloud) InstanceType

func (cloud *Cloud) InstanceType(ctx context.Context, name types.NodeName) (string, error)

InstanceType returns the type of the specified instance.

func (*Cloud) InstanceTypeByProviderID

func (cloud *Cloud) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)

InstanceTypeByProviderID returns the type of the specified instance.

func (*Cloud) Instances

func (cloud *Cloud) Instances() (cloudprovider.Instances, bool)

Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.

func (*Cloud) ListRoutes

func (cloud *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudprovider.Route, error)

ListRoutes lists all managed routes that belong to the specified clusterName

func (*Cloud) LoadBalancer

func (cloud *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)

LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.

func (*Cloud) NodeAddresses

func (cloud *Cloud) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)

NodeAddresses returns the addresses of the specified instance. TODO(roberthbailey): This currently is only used in such a way that it returns the address of the calling instance. We should do a rename to make this clearer.

func (*Cloud) NodeAddressesByProviderID

func (cloud *Cloud) NodeAddressesByProviderID(ctx 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 nodeaddresses are being queried. i.e. local metadata services cannot be used in this method to obtain nodeaddresses

func (*Cloud) ProviderName

func (cloud *Cloud) ProviderName() string

ProviderName returns the cloud provider ID.

func (*Cloud) Routes

func (cloud *Cloud) Routes() (cloudprovider.Routes, bool)

Routes returns a routes interface along with whether the interface is supported.

func (*Cloud) Zones

func (cloud *Cloud) Zones() (cloudprovider.Zones, bool)

Zones returns a zones interface. Also returns true if the interface is supported, false otherwise.

type Config

type Config struct {
	Region string `json:"region"`

	SecretId  string `json:"secret_id"`
	SecretKey string `json:"secret_key"`

	ClusterRouteTable string `json:"cluster_route_table"`
}

Jump to

Keyboard shortcuts

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