cloudprovider

package
v0.17.1-0...-7ba4162 Latest Latest
Warning

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

Go to latest
Published: May 13, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cloudprovider supplies interfaces and implementations for cloud service providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoadBalancerName

func GetLoadBalancerName(service *api.Service) string

TODO(#6812): Use a shorter name that's less likely to be longer than cloud providers' name length limits.

func RegisterCloudProvider

func RegisterCloudProvider(name string, cloud Factory)

RegisterCloudProvider registers a cloudprovider.Factory by name. This is expected to happen during app startup.

Types

type Clusters

type Clusters interface {
	// List lists the names of the available clusters.
	ListClusters() ([]string, error)
	// Master gets back the address (either DNS name or IP address) of the master node for the cluster.
	Master(clusterName string) (string, error)
}

Clusters is an abstract, pluggable interface for clusters of containers.

type Factory

type Factory func(config io.Reader) (Interface, error)

Factory is a function that returns a cloudprovider.Interface. The config parameter provides an io.Reader handler to the factory in order to load specific configurations. If no configuration is provided the parameter is nil.

type Instances

type Instances interface {
	// NodeAddresses returns the addresses of the specified instance.
	NodeAddresses(name string) ([]api.NodeAddress, error)
	// ExternalID returns the cloud provider ID of the specified instance.
	ExternalID(name string) (string, error)
	// List lists instances that match 'filter' which is a regular expression which must match the entire instance name (fqdn)
	List(filter string) ([]string, error)
	// GetNodeResources gets the resources for a particular node
	GetNodeResources(name string) (*api.NodeResources, error)
	// Configure the specified instance using the spec
	Configure(name string, spec *api.NodeSpec) error
	// Delete all the configuration related to the instance, including other cloud resources
	Release(name string) error
}

Instances is an abstract, pluggable interface for sets of instances.

type Interface

type Interface interface {
	// TCPLoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.
	TCPLoadBalancer() (TCPLoadBalancer, bool)
	// Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.
	Instances() (Instances, bool)
	// Zones returns a zones interface. Also returns true if the interface is supported, false otherwise.
	Zones() (Zones, bool)
	// Clusters returns a clusters interface.  Also returns true if the interface is supported, false otherwise.
	Clusters() (Clusters, bool)
}

Interface is an abstract, pluggable interface for cloud providers.

func GetCloudProvider

func GetCloudProvider(name string, config io.Reader) (Interface, error)

GetCloudProvider creates an instance of the named cloud provider, or nil if the name is not known. The error return is only used if the named provider was known but failed to initialize. The config parameter specifies the io.Reader handler of the configuration file for the cloud provider, or nil for no configuation.

func InitCloudProvider

func InitCloudProvider(name string, configFilePath string) Interface

InitCloudProvider creates an instance of the named cloud provider.

type TCPLoadBalancer

type TCPLoadBalancer interface {
	// TODO: Break this up into different interfaces (LB, etc) when we have more than one type of service
	// GetTCPLoadBalancer returns whether the specified load balancer exists, and
	// if so, what its IP address or hostname is.
	GetTCPLoadBalancer(name, region string) (endpoint string, exists bool, err error)
	// CreateTCPLoadBalancer creates a new tcp load balancer. Returns the IP address or hostname of the balancer
	CreateTCPLoadBalancer(name, region string, externalIP net.IP, ports []int, hosts []string, affinityType api.AffinityType) (string, error)
	// UpdateTCPLoadBalancer updates hosts under the specified load balancer.
	UpdateTCPLoadBalancer(name, region string, hosts []string) error
	// DeleteTCPLoadBalancer deletes a specified load balancer.
	DeleteTCPLoadBalancer(name, region string) error
}

TCPLoadBalancer is an abstract, pluggable interface for TCP load balancers.

type Zone

type Zone struct {
	FailureDomain string
	Region        string
}

Zone represents the location of a particular machine.

type Zones

type Zones interface {
	// GetZone returns the Zone containing the current failure zone and locality region that the program is running in
	GetZone() (Zone, error)
}

Zones is an abstract, pluggable interface for zone enumeration.

Directories

Path Synopsis
Package fake_cloud is a test-double implementation of cloudprovider Interface, TCPLoadBalancer and Instances.
Package fake_cloud is a test-double implementation of cloudprovider Interface, TCPLoadBalancer and Instances.
Package gce_cloud is an implementation of Interface, TCPLoadBalancer and Instances for Google Compute Engine.
Package gce_cloud is an implementation of Interface, TCPLoadBalancer and Instances for Google Compute Engine.
Package nodecontroller contains code for syncing cloud instances with minion registry
Package nodecontroller contains code for syncing cloud instances with minion registry
Package servicecontroller contains code for syncing cloud load balancers with the service registry.
Package servicecontroller contains code for syncing cloud load balancers with the service registry.
Package vagrant_cloud is an implementation of Interface, TCPLoadBalancer and Instances for developer managed Vagrant cluster.
Package vagrant_cloud is an implementation of Interface, TCPLoadBalancer and Instances for developer managed Vagrant cluster.

Jump to

Keyboard shortcuts

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