diff --git a/templates/droneworkers/0/README.md b/templates/droneworkers/0/README.md new file mode 100644 index 0000000..b418229 --- /dev/null +++ b/templates/droneworkers/0/README.md @@ -0,0 +1,8 @@ +## Drone Rancher Node Manager + +### Purpose: + +This template will launch a global service and register the nodes as workers with Drone. + + +The manager polls Rancher metadata service every 5 minutes and adds/removes nodes. One agent will run per host, and register a single worker. diff --git a/templates/droneworkers/0/docker-compose.yml b/templates/droneworkers/0/docker-compose.yml new file mode 100644 index 0000000..cb0c1db --- /dev/null +++ b/templates/droneworkers/0/docker-compose.yml @@ -0,0 +1,24 @@ +drone-agent: + labels: + io.rancher.scheduler.global: 'true' + tty: true + image: rancher/socat-docker + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /var/lib/docker:/var/lib/docker + stdin_open: true +dynamic-drones-mgr-0: + environment: + DRONE_TOKEN: ${DRONE_TOKEN} + DRONE_URL: http://droneserver:8000 + external_links: + - ${DRONE_SERVICE}:droneserver + labels: + io.rancher.container.pull_image: always + io.rancher.scheduler.affinity:container_labe_soft_ne: io.rancher.stack_service.name=$${stack_name}/drone-agent + tty: true + entrypoint: + - /dynamic-drone-nodes + - /stacks/${STACK_NAME}/services/drone-agent + image: rancher/drone-config:v0.1.0 + stdin_open: true diff --git a/templates/droneworkers/0/rancher-compose.yml b/templates/droneworkers/0/rancher-compose.yml new file mode 100644 index 0000000..876717a --- /dev/null +++ b/templates/droneworkers/0/rancher-compose.yml @@ -0,0 +1,26 @@ +.catalog: + name: Drone Rancher Node Manager + version: 0.1.0-cloundautique1 + description: | + (Experimental) Poll Rancher Metadata for Drone Agents + and add/remove nodes accordingly. + minimum_rancher_version: v0.56.0 + maintainer: cloudnautique + questions: + - variable: DRONE_TOKEN + type: password + required: true + label: Drone API token + description: "API Token for Drone. (must have admin rights)" + - variable: DRONE_SERVICE + type: service + label: Drone Server + description: "Link to Drone server.(Not the load balancer)" + required: true + - variable: STACK_NAME + type: string + label: Stack name (should be same as above) + description: "Name of this stack, sorry for the duplication." + required: true +dynamic-drones-mgr-0: + scale: 1 diff --git a/templates/droneworkers/catalogIcon-droneio.svg b/templates/droneworkers/catalogIcon-droneio.svg new file mode 100644 index 0000000..be92f11 --- /dev/null +++ b/templates/droneworkers/catalogIcon-droneio.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/templates/droneworkers/config.yml b/templates/droneworkers/config.yml new file mode 100644 index 0000000..e02f13c --- /dev/null +++ b/templates/droneworkers/config.yml @@ -0,0 +1,6 @@ +name: Drone Rancher Node Manager +description: | + (Experimental) Dynamically add remove Drone worker nodes +version: 0.1.0-cloudnautique1 +category: "Continuous Integration" +minimum_rancher_version: v0.56.0