EC2 Autoscale as described in December Meetup

I have attempted to setup an auto-scaling group and Launch configuration for Rancher. The machines launch but the Rancher client does not install. I see nothing unusual in the Console logs. Below is the Cloud config I am using.

#cloud-config
rancher:
  services:
    register:
     privileged: true
       volumes:
       - /var/run/docker.sock:/var/run/docker.sock
       - /var/lib/rancher:/var/lib/rancher   
       image: rancher/agent
       command:
        - http://rancher.panosoft.com:8080/v1/scripts/SECRETKEY

I have also tried it this way:

#!/bin/bash
sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v0.11.0 http://rancher.panosoft.com:8080/v1/scripts/SECRETKEY

But neither seems to work. I can install the agent manually using using the same command in the second example ant it works fine. Any ideas?

Update: I tried it again and the second option does work afterall.

Next question: Is there a way to pass labels to instances using this same method? Then I could have an autoscale group just for my ConvoyFS and another for my DEVTools but both in the same Rancer environment.

The spacing in your docker-compose.yml seems off. Is that exactly what it looks like?

It should look like this:

#cloud-config
rancher:
  services:
    register:
     privileged: true
     volumes:
     - /var/run/docker.sock:/var/run/docker.sock
     - /var/lib/rancher:/var/lib/rancher   
     image: rancher/agent:v0.11.0
     command:
        - http://rancher.panosoft.com:8080/v1/scripts/SECRETKEY
1 Like