Documentation
¶
Overview ¶
Package cloudprovider supplies interfaces and implementations for cloud service providers.
Index ¶
- Variables
- func GetInstanceProviderID(cloud Interface, nodeName string) (string, error)
- func GetLoadBalancerName(service *api.Service) string
- func RegisterCloudProvider(name string, cloud Factory)
- type Clusters
- type Factory
- type Instances
- type Interface
- type Route
- type Routes
- type TCPLoadBalancer
- type Zone
- type Zones
Constants ¶
This section is empty.
Variables ¶
var InstanceNotFound = errors.New("instance not found")
Functions ¶
func GetInstanceProviderID ¶ added in v0.18.0
func GetLoadBalancerName ¶ added in v0.16.0
TODO(#6812): Use a shorter name that's less likely to be longer than cloud providers' name length limits.
func RegisterCloudProvider ¶
RegisterCloudProvider registers a cloudprovider.Factory by name. This is expected to happen during app startup.
Types ¶
type Clusters ¶ added in v0.5.1
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 ¶
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. // 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. NodeAddresses(name string) ([]api.NodeAddress, error) // ExternalID returns the cloud provider ID of the specified instance (deprecated). ExternalID(name string) (string, error) // InstanceID returns the cloud provider ID of the specified instance. InstanceID(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) // 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> AddSSHKeyToAllInstances(user string, keyData []byte) 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) // Routes returns a routes interface along with whether the interface is supported. Routes() (Routes, bool) // ProviderName returns the cloud provider ID. ProviderName() string }
Interface is an abstract, pluggable interface for cloud providers.
func GetCloudProvider ¶
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 ¶ added in v0.5.1
InitCloudProvider creates an instance of the named cloud provider.
type Route ¶ added in v0.18.0
type Route struct { // Name is the name of the routing rule in the cloud-provider. Name string // TargetInstance is the name of the instance as specified in routing rules // for the cloud-provider (in gce: the Instance Name). TargetInstance string // Destination CIDR is the CIDR format IP range that this routing rule // applies to. DestinationCIDR string // Description is a free-form string. It can be useful for tagging Routes. Description string }
Route is a representation of an advanced routing rule.
type Routes ¶ added in v0.18.0
type Routes interface { // List all routes that match the filter ListRoutes(filter string) ([]*Route, error) // Create the described route CreateRoute(route *Route) error // Delete the specified route DeleteRoute(name string) error }
Routes is an abstract, pluggable interface for advanced routing rules.
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 status is. GetTCPLoadBalancer(name, region string) (status *api.LoadBalancerStatus, exists bool, err error) // CreateTCPLoadBalancer creates a new tcp load balancer. Returns the status of the balancer CreateTCPLoadBalancer(name, region string, externalIP net.IP, ports []*api.ServicePort, hosts []string, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error) // UpdateTCPLoadBalancer updates hosts under the specified load balancer. UpdateTCPLoadBalancer(name, region string, hosts []string) error // EnsureTCPLoadBalancerDeleted deletes the specified load balancer if it // exists, returning nil if the load balancer specified either didn't exist or // was successfully deleted. // This construction is useful because many cloud providers' load balancers // have multiple underlying components, meaning a Get could say that the LB // doesn't exist even if some part of it is still laying around. EnsureTCPLoadBalancerDeleted(name, region string) error }
TCPLoadBalancer is an abstract, pluggable interface for TCP load balancers.
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 routecontroller contains code for syncing cloud routing rules with the list of registered nodes.
|
Package routecontroller contains code for syncing cloud routing rules with the list of registered nodes. |
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. |