https://github.com/danielbodnar/rancher-spotinst-agent
rancher-agent for RancherOS + SpotInst.com with a #cloud-config user data.
https://github.com/danielbodnar/rancher-spotinst-agent
Last synced: 11 months ago
JSON representation
rancher-agent for RancherOS + SpotInst.com with a #cloud-config user data.
- Host: GitHub
- URL: https://github.com/danielbodnar/rancher-spotinst-agent
- Owner: danielbodnar
- License: gpl-3.0
- Created: 2016-01-02T03:08:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-26T15:35:52.000Z (about 10 years ago)
- Last Synced: 2025-06-04T21:44:07.056Z (about 1 year ago)
- Language: Shell
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
The [instructions](http://blog.spotinst.com/2015/11/26/rancher-spotinst-how-integration-works/) spotinst provides is for a shell-based user-data file. I was unable to add a CATTLE_HOST_LABELS environment variable for "spotinst.instanceId", using cloud-config / docker-compose yaml syntax on RancherOS.
This image extends the rancher/agent image and changes the docker ENTRYPOINT to a script that export's the CATTLE_HOST_LABELS environment variable and then executes the previous entrypoint (/run.sh).
### Usage
If your EC2 AMI ID is a RancherOS AMI, then insert the following into the "User data" box on SpotInst's "3. Compute" tab.
```
#cloud-config
rancher:
services:
rancher-agent1:
image: danielbodnar/rancher-spotinst-agent:v0.8.2
command: [insert agent string here. e.g.: http://rancher.domain.com:8080/v1/scripts/[token]]
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
```
### Building
```
./build-image.sh v0.8.2 && docker push rancher-spotinst-agent [registry]/[username]/rancher-spotinst-agent:v0.8.2
```