Documentation ¶
Index ¶
- Constants
- type AWSCloud
- func (self *AWSCloud) AddSSHKeyToAllInstances(user string, keyData []byte) error
- func (aws *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly bool) (string, error)
- func (aws *AWSCloud) Clusters() (cloudprovider.Clusters, bool)
- func (v *AWSCloud) Configure(name string, spec *api.NodeSpec) error
- func (s *AWSCloud) CreateTCPLoadBalancer(name, region string, publicIP net.IP, ports []*api.ServicePort, hosts []string, ...) (*api.LoadBalancerStatus, error)
- func (aws *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error)
- func (aws *AWSCloud) DeleteVolume(volumeName string) error
- func (aws *AWSCloud) DetachDisk(instanceName string, diskName string) error
- func (s *AWSCloud) EnsureTCPLoadBalancerDeleted(name, region string) error
- func (aws *AWSCloud) ExternalID(name string) (string, error)
- func (aws *AWSCloud) GetNodeResources(name string) (*api.NodeResources, error)
- func (s *AWSCloud) GetTCPLoadBalancer(name, region string) (*api.LoadBalancerStatus, bool, error)
- func (self *AWSCloud) GetZone() (cloudprovider.Zone, error)
- func (aws *AWSCloud) InstanceID(name string) (string, error)
- func (aws *AWSCloud) Instances() (cloudprovider.Instances, bool)
- func (aws *AWSCloud) List(filter string) ([]string, error)
- func (aws *AWSCloud) NodeAddresses(name string) ([]api.NodeAddress, error)
- func (aws *AWSCloud) ProviderName() string
- func (v *AWSCloud) Release(name string) error
- func (aws *AWSCloud) Routes() (cloudprovider.Routes, bool)
- func (s *AWSCloud) TCPLoadBalancer() (cloudprovider.TCPLoadBalancer, bool)
- func (self *AWSCloud) TCPLoadBalancerExists(name, region string) (bool, error)
- func (s *AWSCloud) UpdateTCPLoadBalancer(name, region string, hosts []string) error
- func (aws *AWSCloud) Zones() (cloudprovider.Zones, bool)
- type AWSCloudConfig
- type AWSMetadata
- type AWSServices
- type EC2
- type ELB
- type VolumeOptions
- type Volumes
Constants ¶
const ProviderName = "aws"
const TagNameKubernetesCluster = "KubernetesCluster"
The tag name we use to differentiate multiple logically independent clusters running in the same AZ
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSCloud ¶
type AWSCloud struct {
// contains filtered or unexported fields
}
AWSCloud is an implementation of Interface, TCPLoadBalancer and Instances for Amazon Web Services.
func (*AWSCloud) AddSSHKeyToAllInstances ¶ added in v0.19.0
func (*AWSCloud) AttachDisk ¶ added in v0.15.0
func (aws *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly bool) (string, error)
Implements Volumes.AttachDisk
func (*AWSCloud) Clusters ¶ added in v0.5.1
func (aws *AWSCloud) Clusters() (cloudprovider.Clusters, bool)
func (*AWSCloud) CreateTCPLoadBalancer ¶ added in v0.19.0
func (s *AWSCloud) CreateTCPLoadBalancer(name, region string, publicIP net.IP, ports []*api.ServicePort, hosts []string, affinity api.ServiceAffinity) (*api.LoadBalancerStatus, error)
CreateTCPLoadBalancer implements TCPLoadBalancer.CreateTCPLoadBalancer TODO(justinsb): This must be idempotent TODO(justinsb) It is weird that these take a region. I suspect it won't work cross-region anwyay.
func (*AWSCloud) CreateVolume ¶ added in v0.15.0
func (aws *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error)
Implements Volumes.CreateVolume
func (*AWSCloud) DeleteVolume ¶ added in v0.15.0
Implements Volumes.DeleteVolume
func (*AWSCloud) DetachDisk ¶ added in v0.15.0
Implements Volumes.DetachDisk
func (*AWSCloud) EnsureTCPLoadBalancerDeleted ¶ added in v0.19.0
EnsureTCPLoadBalancerDeleted implements TCPLoadBalancer.EnsureTCPLoadBalancerDeleted.
func (*AWSCloud) ExternalID ¶ added in v0.12.0
ExternalID returns the cloud provider ID of the specified instance (deprecated).
func (*AWSCloud) GetNodeResources ¶
func (aws *AWSCloud) GetNodeResources(name string) (*api.NodeResources, error)
GetNodeResources implements Instances.GetNodeResources
func (*AWSCloud) GetTCPLoadBalancer ¶ added in v0.19.0
GetTCPLoadBalancer is an implementation of TCPLoadBalancer.GetTCPLoadBalancer
func (*AWSCloud) GetZone ¶ added in v0.13.0
func (self *AWSCloud) GetZone() (cloudprovider.Zone, error)
GetZone implements Zones.GetZone
func (*AWSCloud) InstanceID ¶ added in v0.18.0
InstanceID returns the cloud provider ID of the specified instance.
func (*AWSCloud) Instances ¶
func (aws *AWSCloud) Instances() (cloudprovider.Instances, bool)
Instances returns an implementation of Instances for Amazon Web Services.
func (*AWSCloud) NodeAddresses ¶ added in v0.13.1
func (aws *AWSCloud) NodeAddresses(name string) ([]api.NodeAddress, error)
NodeAddresses is an implementation of Instances.NodeAddresses.
func (*AWSCloud) ProviderName ¶ added in v0.18.0
ProviderName returns the cloud provider ID.
func (*AWSCloud) Routes ¶ added in v0.18.0
func (aws *AWSCloud) Routes() (cloudprovider.Routes, bool)
Routes returns an implementation of Routes for Amazon Web Services.
func (*AWSCloud) TCPLoadBalancer ¶
func (s *AWSCloud) TCPLoadBalancer() (cloudprovider.TCPLoadBalancer, bool)
TCPLoadBalancer returns an implementation of TCPLoadBalancer for Amazon Web Services.
func (*AWSCloud) TCPLoadBalancerExists ¶ added in v0.19.0
TCPLoadBalancerExists implements TCPLoadBalancer.TCPLoadBalancerExists.
func (*AWSCloud) UpdateTCPLoadBalancer ¶ added in v0.19.0
UpdateTCPLoadBalancer implements TCPLoadBalancer.UpdateTCPLoadBalancer
type AWSCloudConfig ¶
type AWSMetadata ¶ added in v0.15.0
type AWSMetadata interface { // Query the EC2 metadata service (used to discover instance-id etc) GetMetaData(key string) ([]byte, error) }
Abstraction over the AWS metadata service
type AWSServices ¶ added in v0.19.0
type AWSServices interface { Compute(region string) (EC2, error) LoadBalancing(region string) (ELB, error) Metadata() AWSMetadata }
Abstraction over AWS, to allow mocking/other implementations
type EC2 ¶
type EC2 interface { // Query EC2 for instances matching the filter DescribeInstances(request *ec2.DescribeInstancesInput) ([]*ec2.Instance, error) // Attach a volume to an instance AttachVolume(volumeID, instanceId, mountDevice string) (resp *ec2.VolumeAttachment, err error) // Detach a volume from an instance it is attached to DetachVolume(request *ec2.DetachVolumeInput) (resp *ec2.VolumeAttachment, err error) // Lists volumes DescribeVolumes(request *ec2.DescribeVolumesInput) ([]*ec2.Volume, error) // Create an EBS volume CreateVolume(request *ec2.CreateVolumeInput) (resp *ec2.Volume, err error) // Delete an EBS volume DeleteVolume(volumeID string) (resp *ec2.DeleteVolumeOutput, err error) DescribeSecurityGroups(request *ec2.DescribeSecurityGroupsInput) ([]*ec2.SecurityGroup, error) CreateSecurityGroup(*ec2.CreateSecurityGroupInput) (*ec2.CreateSecurityGroupOutput, error) DeleteSecurityGroup(request *ec2.DeleteSecurityGroupInput) (*ec2.DeleteSecurityGroupOutput, error) AuthorizeSecurityGroupIngress(*ec2.AuthorizeSecurityGroupIngressInput) (*ec2.AuthorizeSecurityGroupIngressOutput, error) RevokeSecurityGroupIngress(*ec2.RevokeSecurityGroupIngressInput) (*ec2.RevokeSecurityGroupIngressOutput, error) DescribeVPCs(*ec2.DescribeVPCsInput) ([]*ec2.VPC, error) DescribeSubnets(*ec2.DescribeSubnetsInput) ([]*ec2.Subnet, error) CreateTags(*ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error) }
TODO: Should we rename this to AWS (EBS & ELB are not technically part of EC2) Abstraction over EC2, to allow mocking/other implementations Note that the DescribeX functions return a list, so callers don't need to deal with paging
type ELB ¶ added in v0.19.0
type ELB interface { CreateLoadBalancer(*elb.CreateLoadBalancerInput) (*elb.CreateLoadBalancerOutput, error) DeleteLoadBalancer(*elb.DeleteLoadBalancerInput) (*elb.DeleteLoadBalancerOutput, error) DescribeLoadBalancers(*elb.DescribeLoadBalancersInput) (*elb.DescribeLoadBalancersOutput, error) RegisterInstancesWithLoadBalancer(*elb.RegisterInstancesWithLoadBalancerInput) (*elb.RegisterInstancesWithLoadBalancerOutput, error) DeregisterInstancesFromLoadBalancer(*elb.DeregisterInstancesFromLoadBalancerInput) (*elb.DeregisterInstancesFromLoadBalancerOutput, error) }
This is a simple pass-through of the ELB client interface, which allows for testing
type VolumeOptions ¶ added in v0.15.0
type VolumeOptions struct {
CapacityMB int
}
type Volumes ¶ added in v0.15.0
type Volumes interface { // Attach the disk to the specified instance // instanceName can be empty to mean "the instance on which we are running" // Returns the device (e.g. /dev/xvdf) where we attached the volume AttachDisk(instanceName string, volumeName string, readOnly bool) (string, error) // Detach the disk from the specified instance // instanceName can be empty to mean "the instance on which we are running" DetachDisk(instanceName string, volumeName string) error // Create a volume with the specified options CreateVolume(volumeOptions *VolumeOptions) (volumeName string, err error) DeleteVolume(volumeName string) error }
Volumes is an interface for managing cloud-provisioned volumes