ecs-task-kite

command module
v0.0.0-...-8a57589 Latest Latest
Warning

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

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

README

ECS Task Kite

What is "ECS Task Kite"

You and your space-buddy are stowing away on a starship in a pair of corrugated tin containers. You know your best gal, Monday, is stowed away aboard another spaceship near the station. "Hey buddy, did you bring your Kite?" You knock on the container wall to get his attention, "I really need to flash a sig at my girl". "Yeah, my Kite's already out on the Sail, just give me her deets". Moments later, without Monday having a clue where you are, your buddy has used the reflected radiation (or lack thereof) on his Kite to find her and get your signal through. All would be well… if there weren't five girls named Monday and your buddy's Kite picked the wrong one at random.

Fortunately for you, the "Monday Quintuplets" are well designed and stateless so you can hardly tell the difference betwixt the lot of them.

No really, what is it?

ECS Task Kite is a proof of concept ambassador container using the ECS APIs. It's meant to be tiny in terms of memory and disk footprint and simple in terms of operation.

Unlike the ambassador pattern documented above, it is expected that this ambassador only be run on the consumer. It is also expected that the server is not identified by IP directly, but rather by ECS Task Family or by ECS Service Name. Furthermore, it is capable of proxying between multiple servers that meet the above criterion (randomly currently).

It is also expected that it be used via either container links or sharing the network namespace with the consumer. In the case of linking, it does not EXPOSE the appropriate ports (due to them being dynamically discovered at runtime), and thus will not work with the --icc option set to false. By default, --icc is set to true.

Usage

To use the Task Kite, simply add it to your task definition, link to it, and set the below options as appropriate.

Required:

  • Flag: -name=<containerName> set to the name of the container to proxy to within the referenced task or service.
  • Flag: -family=<taskFamily[:revision]> XOR -service=<serviceName>.

Optional:

  • Flag: -public=<true|false>: Whether to proxy to the public IP of the EC2 instance(s); default false.
  • Flag: -cluster=<cluster>: The ECS cluster containing the above tasks or service; default "default".
  • Environment variable: AWS_REGION=<AWS Region> set to the region of the task(s) you will be ambassadoring; default current region.

The Task Kite will proxy to a task of the specified family or within the specified service at random when a connection is made to it on a valid port.

IAM Policy

The Task Kite makes a number of API calls which should be covered by a policy similar to the following:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeContainerInstances",
                "ec2:DescribeInstances",
                "ecs:ListTasks",
                "ecs:DescribeTasks"
            ],
            "Resource": "*"
        }
    ]
}

What is it not?

  • Production ready
  • Highly configurable (perhaps you want HAProxy?)
  • Usable outside of ECS (Have I mentioned HAProxy?)
  • Well tested

Examples

See the subdirectories of the examples directory.

License

Apache 2.0

Contributions

Yes please!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/aws/aws-sdk-go/aws
Package aws provides core functionality for making requests to AWS services.
Package aws provides core functionality for making requests to AWS services.
_workspace/src/github.com/aws/aws-sdk-go/aws/awserr
Package awserr represents API error interface accessors for the SDK.
Package awserr represents API error interface accessors for the SDK.
_workspace/src/github.com/aws/aws-sdk-go/aws/credentials
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds
Package stscreds are credential Providers to retrieve STS AWS credentials.
Package stscreds are credential Providers to retrieve STS AWS credentials.
_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints
Package endpoints validates regional endpoints for services.
Package endpoints validates regional endpoints for services.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query
Package ec2query provides serialisation of AWS EC2 requests and responses.
Package ec2query provides serialisation of AWS EC2 requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/json/jsonutil
Package jsonutil provides JSON serialisation of AWS requests and responses.
Package jsonutil provides JSON serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/jsonrpc
Package jsonrpc provides JSON RPC utilities for serialisation of AWS requests and responses.
Package jsonrpc provides JSON RPC utilities for serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest
Package rest provides RESTful serialization of AWS requests and responses.
Package rest provides RESTful serialization of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil
Package xmlutil provides XML serialisation of AWS requests and responses.
Package xmlutil provides XML serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4
Package v4 implements signing for AWS V4 signer
Package v4 implements signing for AWS V4 signer
_workspace/src/github.com/aws/aws-sdk-go/service/ec2
Package ec2 provides a client for Amazon Elastic Compute Cloud.
Package ec2 provides a client for Amazon Elastic Compute Cloud.
_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface
Package ec2iface provides an interface for the Amazon Elastic Compute Cloud.
Package ec2iface provides an interface for the Amazon Elastic Compute Cloud.
_workspace/src/github.com/aws/aws-sdk-go/service/ecs
Package ecs provides a client for Amazon EC2 Container Service.
Package ecs provides a client for Amazon EC2 Container Service.
_workspace/src/github.com/aws/aws-sdk-go/service/ecs/ecsiface
Package ecsiface provides an interface for the Amazon EC2 Container Service.
Package ecsiface provides an interface for the Amazon EC2 Container Service.
_workspace/src/github.com/golang/mock/gomock
GoMock - a mock framework for Go.
GoMock - a mock framework for Go.
_workspace/src/github.com/vaughan0/go-ini
Package ini provides functions for parsing INI configuration files.
Package ini provides functions for parsing INI configuration files.
lib
ecsclient
Package ecsclient provides a wrapper around the ECS and EC2 apis to provide useful helper functions for this program
Package ecsclient provides a wrapper around the ECS and EC2 apis to provide useful helper functions for this program

Jump to

Keyboard shortcuts

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