diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..72e8ffc0db8aad71a934dd11e5968bd5109e54b4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +* diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b26d23684e3e0d59528ead5c823ff595c8aeb440 --- /dev/null +++ b/.gitignore @@ -0,0 +1,48 @@ +~* +*~ +*.sw[op] +*.py[cod] +.DS_Store +__pycache__/ +.vagrant/ +vendor/ +Thumbs.db +*.retry +.svn/ +.sass-cache/ +*.log +*.out +*.so +node_modules/ +.npm/ +nbproject/ +*.ipynb +.idea/ +*.egg-info/ +*.[ao] +.classpath +.cache/ +bower_components/ +*.class +*.[ewj]ar +secring.* +.*.kate-swp +.swp.* +.directory +.Trash-* +build/ +_build/ +dist/ +.tox/ +*.pdf +*.exe +*.dll +*.gz +*.tgz +*.tar +*.rar +*.zip +*.pid +*.lock +*.env +.bundle/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..143bf12d5d99ccbb74bd7166bc61308fa637672c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM python:3.6-alpine +RUN pip install elasticsearch-curator==5.4.1 +CMD /usr/sbin/crond -f diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..21f83f94ebe311f9f78caffc53a72d754f703e2a --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Adar Nimrod + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d703b638e5009040ecc489bae146159de4d6cfcd --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# curator-docker + +> A dockerized Elasticsearch Curator. + +## Usage + +This image contains the Elasticsearch Curator but runs a Cron daemon. To use +this image you need to provide your `crontab` and perhaps `config.yml` and +`actions.yml` for Curator. + +An example mounting a `crontab` as a volume (every day at 01:00 delete +`logstash-` indices older than 7 days). + +``` +docker run -v crontab:/var/spool/cron/crontabs/nobody:ro adarnimrod/curator +``` + +And the accompanying `crontab` + +``` +0 1 * * * /usr/local/bin/curator_cli --host elastic delete_indices --filter_list '[{"filtertype": "pattern", "kind": "prefix", "value": "logstash-"}, {"filtertype": "age", "source": "creation_date", "direction": "older", "unit": "days", "unit_count": 7}]' +``` + +Or you can build your own image, using this one as a base + +``` +FROM adarnimrod/curator +COPY config.yml /etc/curator.yml +COPY actions.yml /actions.yml +COPY crontab /var/spool/cron/crontabs/nobody +``` + +## License + +This software is licensed under the MIT license (see `LICENSE.txt`). + +## Author Information + +Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my [website]( +https://www.shore.co.il/). Patches are welcome via [`git send-email`]( +http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is located +at: <https://www.shore.co.il/git/>.