diff --git a/templates/janitor/4/docker-compose.yml b/templates/janitor/4/docker-compose.yml new file mode 100644 index 0000000..431ade2 --- /dev/null +++ b/templates/janitor/4/docker-compose.yml @@ -0,0 +1,20 @@ +cleanup: + image: meltwater/docker-cleanup:1.8.0 + environment: + CLEAN_PERIOD: ${FREQUENCY} + DELAY_TIME: "900" + KEEP_IMAGES: "${KEEP}" + KEEP_CONTAINERS: "${KEEPC}" + KEEP_CONTAINERS_NAMED: "${KEEPCN}" + LOOP: "${LOOP}" + DEBUG: "${DEBUG}" + labels: + io.rancher.scheduler.global: "true" + io.rancher.scheduler.affinity:host_label_ne: "${EXCLUDE_LABEL}" + net: none + privileged: true + tty: false + stdin_open: false + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /var/lib/docker:/var/lib/docker diff --git a/templates/janitor/4/rancher-compose.yml b/templates/janitor/4/rancher-compose.yml new file mode 100644 index 0000000..8db4a8a --- /dev/null +++ b/templates/janitor/4/rancher-compose.yml @@ -0,0 +1,54 @@ +.catalog: + name: "Janitor" + version: "v1.7.1" + description: "Docker cleanup" + uuid: janitor-3 + 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 Janitor 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. These are left-anchored Bash Shell Wildcard patterns." + default: "rancher/" + required: false + type: "string" + - variable: "KEEPC" + label: "Keep containers" + description: "A comma separated list of images that should never have stopped containers removed. These are left-anchored Bash Shell Wildcard patterns." + default: "*:*" + required: false + type: "string" + - variable: "KEEPCN" + label: "Keep named containers" + description: "A comma separated list of names of exited or dead container that should never be removed. These are left-anchored Bash Shell Wildcard patterns." + default: "*-datavolume" + required: false + type: "string" + - variable: "DEBUG" + label: "Enable more debugging output on pattern matches" + description: "Read https://github.com/meltwater/docker-cleanup#environment-variables" + required: true + default: 0 + type: "enum" + options: + - 0 + - 1 + - variable: "LOOP" + label: "Ability to do non-looped cleanups, run it once and exit. Defaults to yes to run it forever in loops." + description: "Read https://github.com/meltwater/docker-cleanup#environment-variables" + required: true + default: true + type: "enum" + options: + - false + - true diff --git a/templates/janitor/config.yml b/templates/janitor/config.yml index 082b015..b128907 100644 --- a/templates/janitor/config.yml +++ b/templates/janitor/config.yml @@ -1,7 +1,7 @@ name: Janitor description: | Automatic cleanup of unused images on hosts, in order to save disk space. -version: v1.7 +version: v1.7.1 category: Monitoring maintainer: Steve Shipway