Merge pull request #22 from cloudnautique/drone_agents
Added drone manager
This commit is contained in:
commit
651bd80422
8
templates/droneworkers/0/README.md
Normal file
8
templates/droneworkers/0/README.md
Normal file
@ -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.
|
24
templates/droneworkers/0/docker-compose.yml
Normal file
24
templates/droneworkers/0/docker-compose.yml
Normal file
@ -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
|
26
templates/droneworkers/0/rancher-compose.yml
Normal file
26
templates/droneworkers/0/rancher-compose.yml
Normal file
@ -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
|
93
templates/droneworkers/catalogIcon-droneio.svg
Normal file
93
templates/droneworkers/catalogIcon-droneio.svg
Normal file
@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="43"
|
||||
height="36.350704"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.3.1 r9886"
|
||||
sodipodi:docname="drone-logo-no-circle.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#2b303b"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.8"
|
||||
inkscape:cx="26.576205"
|
||||
inkscape:cy="-72.54425"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:snap-global="false"
|
||||
inkscape:window-width="1295"
|
||||
inkscape:window-height="744"
|
||||
inkscape:window-x="65"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid2996"
|
||||
empspacing="5"
|
||||
visible="true"
|
||||
enabled="true"
|
||||
snapvisiblegridlinesonly="true"
|
||||
originx="-21.720779px"
|
||||
originy="-990.37188px" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-21.720779,-25.639593)">
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="fill:#2b303b;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="path2998"
|
||||
sodipodi:cx="172.10474"
|
||||
sodipodi:cy="458.39249"
|
||||
sodipodi:rx="5.4295697"
|
||||
sodipodi:ry="5.0507627"
|
||||
d="m 177.53431,458.39249 c 0,2.78946 -2.43091,5.05076 -5.42957,5.05076 -2.99867,0 -5.42957,-2.2613 -5.42957,-5.05076 0,-2.78946 2.4309,-5.05077 5.42957,-5.05077 2.99866,0 5.42957,2.26131 5.42957,5.05077 z"
|
||||
transform="matrix(1.0129716,0,0,1.0889445,-131.11643,-452.42373)" />
|
||||
<path
|
||||
style="fill:#2b303b;fill-opacity:1;stroke-width:0;stroke-miterlimit:4"
|
||||
d="m 43.220779,25.640247 c 9.60163,0.0752 20.51786,6.8438 21.5,19.6 l -13,0 c 0,0 -1.67472,-7.04733 -8.5,-7 -6.82528,0.0473 -8.5,7 -8.5,7 l -13,0 c 0.63161,-12.53073 11.36576,-19.67935 21.5,-19.6 z"
|
||||
id="rect3810"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="scczccs" />
|
||||
<path
|
||||
style="fill:#2b303b;fill-opacity:1;stroke-width:0;stroke-miterlimit:4"
|
||||
d="m 43.310069,61.990247 c -7.159395,0.01905 -13.847588,-5.383347 -16.58929,-13.75 l 8,0 c 0,0 1.72575,6.96782 8.55103,6.92049 6.82528,-0.0473 8.44897,-6.92049 8.44897,-6.92049 l 8,0 c -1.783351,8.850973 -9.251314,13.730946 -16.41071,13.75 z"
|
||||
id="rect3810-1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="scczccs" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.4 KiB |
6
templates/droneworkers/config.yml
Normal file
6
templates/droneworkers/config.yml
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user