awselbv1

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

README

AWS ELBv1 (ELB Classic Load Balancer) Provider

About ELB Classic Load Balancers

The Classic Load Balancer option in AWS routes traffic based on application or network level information and is ideal for simple load balancing of traffic across multiple EC2 instances.

About this provider

This provider keeps pre-existing Classic Load Balancers updated with the EC2 instances Rancher services are running on, allowing one to use Elastic Load Balancing to load balancer Rancher services.

Usage
  1. Deploy the stack for this provider from the Rancher Catalog
  2. Using the AWS Console create a Classic ELB load balancer with one or more listeners and configure it according to your applications requirements. Configure the listener(s) with an "instance protocol" matching that of your application as well as the "instance port" that your Rancher service will expose to the hosts.
  3. Create or update your service to expose one or multiple host ports that match the configuration of your ELB listener(s). Then add the service label io.rancher.service.external_lb.endpoint using as value the name of the previously created ELB load balancer.

Environment Variables

The following environment variables are used to configure global options for this provider.

Variable Description Default value
ELBV2_AWS_ACCESS_KEY Your AWS Access Key. Make sure this key has sufficient permissions for the operations required to manage an ELB load balancer. -
ELBV2_AWS_SECRET_KEY Your AWS Secret Key. -
ELBV2_AWS_REGION By default the service will use the region of the instance it is running on to look up the IDs of EC instances. You can override the region by setting this variable. <Self-Region>
ELBV2_AWS_VPCID By default the service will use the VPC of the instance this service is running on to look up the IDs of EC instances. You can override the VPC by setting this variable. <Self-VPC>
ELBV2_USE_PRIVATE_IP If your EC2 instances are registered in Rancher with their private IP addresses, then set this variable to "true". false

Note: Instead of specifying AWS credentials when deploying the stack you can create an IAM policy and role and associate it with your EC2 instances.

Required AWS IAM permissions

The following IAM policy describes the minimum set of permissions needed for the AWS ELBv1 implentation to work.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "ec2:DescribeInstances"
      ],
      "Effect": "Allow",
      "Resource": "*"
    },
    {
      "Action": [
        "elasticloadbalancing:AddTags",
        "elasticloadbalancing:DeregisterInstancesFromLoadBalancer",
        "elasticloadbalancing:DescribeInstanceHealth",
        "elasticloadbalancing:DescribeLoadBalancers",
        "elasticloadbalancing:DescribeTags",
        "elasticloadbalancing:RegisterInstancesWithLoadBalancer",
        "elasticloadbalancing:RemoveTags"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}

License

Copyright (c) 2016 Rancher Labs, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

View Source
const (
	ProviderName = "AWS ELB Classic"
	ProviderSlug = "elbv1"
)
View Source
const (
	TagNameTargetPool  = "external-lb/targetPoolName"
	TagNameServicePort = "external-lb/servicePort"
)
View Source
const (
	EnvVarAWSAccessKey = "ELBV1_AWS_ACCESS_KEY"
	EnvVarAWSSecretKey = "ELBV1_AWS_SECRET_KEY"
	EnvVarAWSRegion    = "ELBV1_AWS_REGION"
	EnvVarAWSVpcID     = "ELBV1_AWS_VPCID"
	EnvVarUsePrivateIP = "ELBV1_USE_PRIVATE_IP"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSELBv1Provider

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

AWSELBv1Provider implements the providers.Provider interface.

func (*AWSELBv1Provider) AddLBConfig

func (p *AWSELBv1Provider) AddLBConfig(config model.LBConfig) (string, error)

func (*AWSELBv1Provider) GetLBConfigs

func (p *AWSELBv1Provider) GetLBConfigs() ([]model.LBConfig, error)

func (*AWSELBv1Provider) GetName

func (*AWSELBv1Provider) GetName() string

func (*AWSELBv1Provider) HealthCheck

func (p *AWSELBv1Provider) HealthCheck() error

func (*AWSELBv1Provider) Init

func (p *AWSELBv1Provider) Init() error

func (*AWSELBv1Provider) RemoveLBConfig

func (p *AWSELBv1Provider) RemoveLBConfig(config model.LBConfig) error

func (*AWSELBv1Provider) UpdateLBConfig

func (p *AWSELBv1Provider) UpdateLBConfig(config model.LBConfig) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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