Add Janitor container definition

This commit is contained in:
Steve Shipway 2016-03-04 01:45:37 +00:00
parent ffc90ce0c5
commit aa7337cfeb
5 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,15 @@
cleanup:
image: meltwater/docker-cleanup:1.4.0
environment:
CLEAN_PERIOD: ${FREQUENCY}
DELAY_TIME: "900"
KEEP_IMAGES: ${KEEP}
labels:
io.rancher.scheduler.global: "true"
io.rancher.scheduler.affinity:host_label_ne: ${EXCLUDE_LABEL}
privileged: true
tty: true
stdin_open: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker:/var/lib/docker

View File

@ -0,0 +1,25 @@
.catalog:
name: "Janitor"
version: "v1.4.0"
description: "Docker cleanup"
uuid: janitor-0
questions:
- variable: "FREQUENCY"
label: "Frequency"
description: "Run the cleanup on a cycle of this many seconds"
default: 3600
required: true
type: "int"
- variable: "EXCLUDE_LABEL"
label: "Exclude label"
description: "Specify a Rancher host label here that will be used to determine on which hosts the container should not deploy."
default: janitor.exclude=true
required: true
type: "string"
- variable: "KEEP"
label: "Keep images"
description: "A comma separated list of images that should never be removed"
default: "rancher/agent:v0.8.2,rancher/agent-instance:v0.6.0"
required: false
type: "string"

View File

@ -0,0 +1,16 @@
# Janitor
### Topology
A Janitor instance will be started on every host that does not match the
scheduling rule (default is `janitor.exclude=true`).
### Operation
This will run a task daily (by default) that will delete any unused
image, and any orphaned volume. The rancher container images are excluded
from the list of images to clean up.
This will halp to prevent the /var/lib/docker filesystem from filling up
with old and unused container images.

View File

@ -0,0 +1,31 @@
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 600 600"><rect id="svgEditorBackground" x="0" y="0" width="600" height="600" style="fill: none; stroke: none;"/>
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<g>
<title>Layer 1</title>
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#5b8805;stop-opacity:1"/>
<stop offset="100%" style="stop-color:#5b8805;stop-opacity:0"/>
</linearGradient>
</defs>
<ellipse ry="300" rx="300" id="svg_1" cy="300" cx="300" stroke-width="0" stroke="#000000" fill="#79b506"/>
<path d="M191 479.5 L 300 479.5 L 300 600" style="fill:#5b8805; stroke:purple;stroke-width:0"/>
<path d="M426.5 145 L 600 300 L 420 300" style="fill:#5b8805; stroke:purple;stroke-width:0"/>
<path d="M300 600 A 300 300, 0, 0, 0, 600 300 L 300 300 Z" fill="#5b8805"/>
<path d="M 300 300 L 300 470 L 400 470 L 410 300" style="fill:#79b506; stroke:purple;stroke-width:0"/>
<line stroke-linecap="round" x1="180" y1="159.25" x2="420" y2="159.25" style="stroke:rgb(255,255,255);stroke-width:30"/>
<rect x="250" y="129.25" rx="20" ry="20" width="100" height="30" style="fill: transparent; stroke:#fff; stroke-width:10"/>
<line stroke-linecap="round" x1="189" y1="198.75" x2="200" y2="466.75" style="stroke:rgb(255,255,255);stroke-width:25"/>
<line id="bottom" stroke-linecap="round" x1="411" y1="198.75" x2="400" y2="466.75" style="stroke:rgb(255,255,255);stroke-width:25"/>
<line stroke-linecap="square" x1="189" y1="198.75" x2="411" y2="198.75" style="stroke:rgb(255,255,255);stroke-width:25"/>
<line stroke-linecap="round" x1="203" y1="470.75" x2="397" y2="470.75" style="stroke:rgb(255,255,255);stroke-width:30"/>
<line stroke-linecap="round" x1="260" y1="198.75" x2="265" y2="470.75" style="stroke:rgb(255,255,255);stroke-width:25"/>
<line stroke-linecap="round" x1="340" y1="198.75" x2="335" y2="470.75" style="stroke:rgb(255,255,255);stroke-width:25"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,7 @@
name: Janitor
description: |
Automatic cleanup of unused images on hosts, in order to save disk space.
version: v1.4.0
category: monitoring
maintainer: Steve Shipway <s.shipway@auckland.ac.nz>