Code Monkey home page Code Monkey logo

ecs-gen's People

Contributors

codesuki avatar djwinter avatar lucaschain avatar masterful avatar simplesteph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ecs-gen's Issues

Support for multiple exposed ports per task?

My use-case is with a service that exposes an API port and a management web interface on different ports. Is there any way of supporting multiple exposed ports in a task definition?

invalid memory address or nil pointer

nginx-ecs-proxy container continuously getting killed with the following error.

2017/04/03 13:51:05 updating config
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x403a3d]

goroutine 1 [running]:
panic(0x97b5c0, 0xc420010030)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
main.(*scanner).makeIDAddressMap(0xc420155d80, 0x6, 0xa362ad, 0x6)
/go/src/github.com/codesuki/ecs-gen/scanner.go:58 +0x17d
main.(*scanner).scan(0xc420155d80, 0xc420155dc0, 0x412cce, 0xc4200201f8, 0x8, 0x8)
/go/src/github.com/codesuki/ecs-gen/scanner.go:36 +0x171
main.updateAndWrite(0xc4200201e0, 0xc4200201f8)
/go/src/github.com/codesuki/ecs-gen/main.go:95 +0x99
main.execute(0xc4200201e0, 0xc4200201f8)
/go/src/github.com/codesuki/ecs-gen/main.go:80 +0x55
main.main()
/go/src/github.com/codesuki/ecs-gen/main.go:73 +0x1d1

Not sure what's causing it. But It was working fine when we first deployed. During Off Hours, We put our autoscaling group to suspend state and resume during the work hours. After resuming the autoscaling group from a suspended state, we continuously see this issue.

panic: runtime error: index out of range

Good night, I had this problem when trying ecs-gen, I'm using the default nginx template from codesuki/ecs-nginx-proxy

here's my command output:

[chain@localhost dev]$ ./ecs-gen-linux-amd64 --template=nginx.tmpl --output=out --cluster=kanto
2017/02/21 02:13:45 updating config
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x97b5c0, 0xc42000e160)
	/usr/local/go/src/runtime/panic.go:500 +0x1a1
main.(*ecsClient).describeCluster(0xc4200961f0, 0x7ffc3b4c2262, 0x5, 0x9161e0, 0xc420075f20, 0xc4200e1640)
	/go/src/github.com/codesuki/ecs-gen/ecs.go:27 +0x142
main.(*scanner).scan(0xc420043d90, 0xc420043dd0, 0x412bce, 0xc4200961f0, 0x8, 0x8)
	/go/src/github.com/codesuki/ecs-gen/scanner.go:29 +0xc3
main.updateAndWrite(0xc4200961d8, 0xc4200961f0)
	/go/src/github.com/codesuki/ecs-gen/main.go:95 +0x99
main.execute(0xc4200961d8, 0xc4200961f0)
	/go/src/github.com/codesuki/ecs-gen/main.go:80 +0x55
main.main()
	/go/src/github.com/codesuki/ecs-gen/main.go:73 +0x1d1

My only cluster's EC2 intance has the following inline permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "*****************",
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeClusters",
                "ecs:DescribeContainerInstances",
                "ecs:DescribeServices",
                "ecs:DescribeTaskDefinition",
                "ecs:DescribeTasks",
                "ecs:ListClusters",
                "ecs:ListContainerInstances",
                "ecs:ListServices",
                "ecs:ListTaskDefinitionFamilies",
                "ecs:ListTaskDefinitions",
                "ecs:ListTasks"
            ],
            "Resource": [
                "arn:aws:ecs:::*/*"
            ]
        }
    ]
}

Is there anything I'm doing wrong?

Should find default ECS_REGION

I was experiencing the same issue as #5

Basically I'm in ap-southeast-2 and my ECS cluster is there.
Your code finds the cluster because of the log:

2017/03/06 03:44:09 found cluster name to be: test-reverse-proxy

Your code should also be smart enough to find the region its running in. I don't know Go so can't do a PR, but a way of doing it in bash would be:

export AWS_AVAILABILITY_ZONE
AWS_AVAILABILITY_ZONE=$(curl --fail --silent --show-error http://169.254.169.254/latest/meta-data/placement/availability-zone)
export AWS_REGION
AWS_REGION="`echo \"$AWS_AVAILABILITY_ZONE\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"

Support for basic_auth

thoughts about supporting basic_auth ?
Basically I'm thinking of VIRTUAL_BASIC_AUTH=admin:hashedpassword by leveraging apache2-utils. Each container could optionally have that variable which would allow us to generate the htpassword dynamically at /etc/nginx/htpassw/$VIRTUAL_HOST

HAProxy

What would be required to get this running to generate configuration for HAProxy reverse proxy setups?

Using multiple domain names causes an error

docker inspect on my app container shows:

      "Env": [
        "VIRTUAL_HOST=kegduino.org www.kegduino.org",

My task definition:

      "environment": [
        {
          "name": "VIRTUAL_HOST",
          "value": "kegduino.org www.kegduino.org"
        }
      ],

However the reverse proxy errors with:

2018/07/10 18:25:49 found cluster region to be: us-east-1
2018/07/10 18:25:49 found cluster name to be: App 
2018/07/10 18:25:49 updating config
2018/07/10 18:25:49 [reverse-proxy] virtual_host environment variable not found. skipping
2018/07/10 18:25:49 running signal command
2018/07/10 18:25:50 ===== output start =====
2018/07/10 18:25:50 2018/07/10 18:25:49 [emerg] 14#14: invalid number of arguments in "upstream" directive in /etc/nginx/conf.d/default.conf:43
nginx: [emerg] invalid number of arguments in "upstream" directive in /etc/nginx/conf.d/default.conf:43
2018/07/10 18:25:50 ===== output end =====
2018/07/10 18:25:50 failed to run signal command
2018/07/10 18:25:50 error:  exit status 1
2018/07/10 18:25:50 []

Load Balancing

Any support for supporting two nodes for a Task in ECS? It took me a bit to get this working, as it threw an error if there were two nodes with the same Virtual_Host. First I want to confirm that this does not work yet and is a future task. This was somewhat hard to track down as it caused the container to keep restarting.

Past this, this script works great for one node setups. Let me know on the load balancing piece, I may have time to look into this later this week. Good job!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.