From 59d9f3c76658302674d72f600e28c78f73dfb7d9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Steenis Date: Mon, 26 Feb 2018 12:00:19 +0100 Subject: [PATCH] Add imagesyncer 0.1.0 --- .../imagesyncer/0/docker-compose.yml.tpl | 24 ++++++++ .../imagesyncer/0/rancher-compose.yml | 58 +++++++++++++++++++ .../imagesyncer/catalogIcon-imagesyncer.svg | 28 +++++++++ infra-templates/imagesyncer/config.yml | 8 +++ 4 files changed, 118 insertions(+) create mode 100644 infra-templates/imagesyncer/0/docker-compose.yml.tpl create mode 100644 infra-templates/imagesyncer/0/rancher-compose.yml create mode 100644 infra-templates/imagesyncer/catalogIcon-imagesyncer.svg create mode 100644 infra-templates/imagesyncer/config.yml diff --git a/infra-templates/imagesyncer/0/docker-compose.yml.tpl b/infra-templates/imagesyncer/0/docker-compose.yml.tpl new file mode 100644 index 0000000..c5a0eac --- /dev/null +++ b/infra-templates/imagesyncer/0/docker-compose.yml.tpl @@ -0,0 +1,24 @@ +version: '2' +services: + imagesyncer: + image: superseb/imagesyncer:0.1.0 + {{- if eq .Values.PRIVILEGED "true"}} + privileged: true + {{- end}} + environment: + CHECK_CPU_USAGE: ${CHECK_CPU_USAGE} + CHECK_INTERVAL: ${CHECK_INTERVAL} + CPU_USAGE_MAX: ${CPU_USAGE_MAX} + CPU_USAGE_SLEEP: ${CPU_USAGE_SLEEP} + RANDOM_SLEEP: ${RANDOM_SLEEP} + stdin_open: true + volumes: + - /var/run/docker.sock:/var/run/docker.sock + {{- if eq .Values.MOUNT_DOCKER_CONFIG "true"}} + - ${DOCKER_CONFIG_LOCATION}:/root/.docker/config.json + {{- end}} + tty: true + labels: + io.rancher.container.agent.role: environment + io.rancher.container.create_agent: 'true' + io.rancher.scheduler.global: 'true' diff --git a/infra-templates/imagesyncer/0/rancher-compose.yml b/infra-templates/imagesyncer/0/rancher-compose.yml new file mode 100644 index 0000000..04fd169 --- /dev/null +++ b/infra-templates/imagesyncer/0/rancher-compose.yml @@ -0,0 +1,58 @@ +version: '2' +catalog: + name: imagesyncer + version: 0.1.0 + description: Sync all images in use in your environment to all hosts + minimum_rancher_version: v1.6.0 + questions: + - variable: CHECK_CPU_USAGE + label: CHECK_CPU_USAGE + description: Enable CPU usage check + type: boolean + default: true + required: true + - variable: CHECK_INTERVAL + label: CHECK_INTERVAL + description: Amount of seconds to sleep before checking images + type: int + default: 300 + required: true + - variable: CPU_USAGE_MAX + label: CPU_USAGE_MAX + description: Maximum CPU usage in % to halt pulling images + type: int + default: 75 + required: true + - variable: CPU_USAGE_SLEEP + label: CPU_USAGE_SLEEP + description: Amount of seconds to sleep when cpu usage is too high + type: int + default: 120 + required: true + - variable: MOUNT_DOCKER_CONFIG + label: MOUNT_DOCKER_CONFIG + description: Mount docker config as volume (for registries with authentication) + type: boolean + default: false + required: true + - variable: DOCKER_CONFIG_LOCATION + label: DOCKER_CONFIG_LOCATION + description: Docker config location on the host (for registries with authentication) + type: string + default: "/root/.docker/config.json" + required: true + - variable: PRIVILEGED + label: PRIVILEGED + description: Run as privileged (e.g. when SELinux is enabled) + type: boolean + default: false + required: true + - variable: RANDOM_SLEEP + label: RANDOM_SLEEP + description: Sleep a "random" amount of seconds between image pulls + type: boolean + default: false + required: true +services: + imagesyncer: + start_on_create: true diff --git a/infra-templates/imagesyncer/catalogIcon-imagesyncer.svg b/infra-templates/imagesyncer/catalogIcon-imagesyncer.svg new file mode 100644 index 0000000..b4c2b30 --- /dev/null +++ b/infra-templates/imagesyncer/catalogIcon-imagesyncer.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/infra-templates/imagesyncer/config.yml b/infra-templates/imagesyncer/config.yml new file mode 100644 index 0000000..5a47b71 --- /dev/null +++ b/infra-templates/imagesyncer/config.yml @@ -0,0 +1,8 @@ +name: Imagesyncer +description: | + Sync all images in use in your environment to all hosts +version: 0.1.0 +category: Automation +maintainer: "Sebastiaan van Steenis " +license: Apache 2.0 +projectURL: https://github.com/superseb/imagesyncer