From 23d9e32225302e6bc5c2c1e74c7fb7b46aff138a Mon Sep 17 00:00:00 2001 From: Josh Reichardt Date: Tue, 13 Sep 2016 10:26:47 -0700 Subject: [PATCH 1/3] sysdig-cloud: Cut logs at 100mb and make into a system service --- templates/sysdig-cloud/1/docker-compose.yml | 22 +++++++++++++ templates/sysdig-cloud/1/rancher-compose.yml | 34 ++++++++++++++++++++ templates/sysdig-cloud/config.yml | 6 ++-- 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 templates/sysdig-cloud/1/docker-compose.yml create mode 100644 templates/sysdig-cloud/1/rancher-compose.yml diff --git a/templates/sysdig-cloud/1/docker-compose.yml b/templates/sysdig-cloud/1/docker-compose.yml new file mode 100644 index 0000000..89e5f57 --- /dev/null +++ b/templates/sysdig-cloud/1/docker-compose.yml @@ -0,0 +1,22 @@ +sysdig-agent: + container_name: sysdig-agent + privileged: true + image: sysdig/agent:${VERSION} + net: "host" + pid: "host" + environment: + ACCESS_KEY: ${SDC_ACCESS_KEY} + TAGS: "${SDC_TAGS}" + ADDITIONAL_CONF: "${SDC_ADDITIONAL_CONF}" + log_opt: + max-size: 100mb + volumes: + - /var/run/docker.sock:/host/var/run/docker.sock + - /dev:/host/dev + - /proc:/host/proc:ro + - /boot:/host/boot:ro + - /lib/modules:/host/lib/modules:ro + - /usr:/host/usr:ro + labels: + io.rancher.scheduler.global: true + io.rancher.scheduler.affinity:host_label_ne: ${HOST_EXCLUDE_LABEL} diff --git a/templates/sysdig-cloud/1/rancher-compose.yml b/templates/sysdig-cloud/1/rancher-compose.yml new file mode 100644 index 0000000..c7433c4 --- /dev/null +++ b/templates/sysdig-cloud/1/rancher-compose.yml @@ -0,0 +1,34 @@ +.catalog: + name: "Sysdig Cloud" + version: "v1" + description: "Container-Native Application and Infrastructure Monitoring" + minimum_rancher_version: v1.0.1 + uuid: sysdig-cloud-1 + questions: + - variable: "SDC_ACCESS_KEY" + label: "Sysdig Cloud access key" + description: "Your unique Sysdig Cloud access key - register for a Sysdig Cloud account at www.sysdig.com to receive a key." + type: "string" + required: true + - variable: "SDC_TAGS" + label: "Sysdig Cloud tags" + description: "Tags to be applied to all hosts on which the Sysdig Cloud container is deployed - these will surface in the Sysdig Cloud app. Should be a comma-separated list in the form of TAG_NAME:TAG_VALUE. For example: role:webserver,location:europe." + type: "string" + required: false + - variable: "VERSION" + label: "Sysdig Cloud version" + description: "Specify a version of the Sysdig Cloud container to pull (default will pull latest stable version)." + type: "string" + default: "latest" + required: true + - variable: "HOST_EXCLUDE_LABEL" + label: "Host exclude label" + description: "Specify a Rancher host label here that can be used to exclude deployment of the Sysdig Cloud container on any given host. Eg: sysdig.exclude_sysdigcloud=true (you could then add the label 'sysdig.exclude_sysdigcloud=true' to any Rancher host to exclude Sysdig Cloud from that host). To filter on any of multiple labels, use a comma-separated list." + type: "string" + default: sysdig.exclude_sysdigcloud=true + required: true + - variable: "SDC_ADDITIONAL_CONF" + label: "Additional Configuration" + description: "Content must be valid yaml code, use the escape \n parameter for new lines and adhere to proper indent requirements." + type: "string" + required: false diff --git a/templates/sysdig-cloud/config.yml b/templates/sysdig-cloud/config.yml index 6bf4120..b428c1a 100644 --- a/templates/sysdig-cloud/config.yml +++ b/templates/sysdig-cloud/config.yml @@ -1,5 +1,5 @@ -name: Sysdig Cloud +name: Sysdig Cloud v1 description: | Container-Native Application and Infrastructure Monitoring -version: v0 -category: Monitoring +version: v1 +category: Rancher Services From 2b0eab6b196b9becc71c3eef6c3430094a40c63f Mon Sep 17 00:00:00 2001 From: Josh Reichardt Date: Mon, 28 Nov 2016 17:16:46 -0800 Subject: [PATCH 2/3] Make log size adjustable --- templates/sysdig-cloud/1/docker-compose.yml | 2 +- templates/sysdig-cloud/1/rancher-compose.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/sysdig-cloud/1/docker-compose.yml b/templates/sysdig-cloud/1/docker-compose.yml index 89e5f57..164ab3f 100644 --- a/templates/sysdig-cloud/1/docker-compose.yml +++ b/templates/sysdig-cloud/1/docker-compose.yml @@ -9,7 +9,7 @@ sysdig-agent: TAGS: "${SDC_TAGS}" ADDITIONAL_CONF: "${SDC_ADDITIONAL_CONF}" log_opt: - max-size: 100mb + max-size: ${log_size} volumes: - /var/run/docker.sock:/host/var/run/docker.sock - /dev:/host/dev diff --git a/templates/sysdig-cloud/1/rancher-compose.yml b/templates/sysdig-cloud/1/rancher-compose.yml index c7433c4..d4a30df 100644 --- a/templates/sysdig-cloud/1/rancher-compose.yml +++ b/templates/sysdig-cloud/1/rancher-compose.yml @@ -32,3 +32,9 @@ description: "Content must be valid yaml code, use the escape \n parameter for new lines and adhere to proper indent requirements." type: "string" required: false + - variable: "log_size" + label: "Max log size" + description: "Max log size" + type: "string" + default: 100mb + required: true From 671046f0e1da5e935ed2c5e5c4f5b5279f430aa8 Mon Sep 17 00:00:00 2001 From: Josh Reichardt Date: Tue, 29 Nov 2016 10:01:10 -0800 Subject: [PATCH 3/3] Use consistent variables --- templates/sysdig-cloud/1/docker-compose.yml | 2 +- templates/sysdig-cloud/1/rancher-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/sysdig-cloud/1/docker-compose.yml b/templates/sysdig-cloud/1/docker-compose.yml index 164ab3f..f456257 100644 --- a/templates/sysdig-cloud/1/docker-compose.yml +++ b/templates/sysdig-cloud/1/docker-compose.yml @@ -9,7 +9,7 @@ sysdig-agent: TAGS: "${SDC_TAGS}" ADDITIONAL_CONF: "${SDC_ADDITIONAL_CONF}" log_opt: - max-size: ${log_size} + max-size: ${LOG_SIZE} volumes: - /var/run/docker.sock:/host/var/run/docker.sock - /dev:/host/dev diff --git a/templates/sysdig-cloud/1/rancher-compose.yml b/templates/sysdig-cloud/1/rancher-compose.yml index d4a30df..b0d4b57 100644 --- a/templates/sysdig-cloud/1/rancher-compose.yml +++ b/templates/sysdig-cloud/1/rancher-compose.yml @@ -32,7 +32,7 @@ description: "Content must be valid yaml code, use the escape \n parameter for new lines and adhere to proper indent requirements." type: "string" required: false - - variable: "log_size" + - variable: "LOG_SIZE" label: "Max log size" description: "Max log size" type: "string"