Commit 527807b5 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request redmic-project/elastic/curator!12
parents 071b655e fb1ce4b1
Loading
Loading
Loading
Loading
+197 −193
Original line number Diff line number Diff line
include:
  - project: 'redmic-project/gitlab-ci-templates'
    ref: master
    file: '/_deployment.yml'
  - project: 'redmic-project/gitlab-ci-templates'
    ref: master
    file: '/maintenance.yml'

stages:
  - deploy
  - maintenance

image: ${DOCKER_DEPLOY_IMAGE_NAME}:${DOCKER_DEPLOY_IMAGE_TAG}
variables:
  PROJECT_PARENT_NAME: elastic

# Deployment

.deploy:
  variables:
  DOCKER_DRIVER: overlay2
  STACK: elastic
    STACK: ${PROJECT_PARENT_NAME}
    STATUS_CHECK_DELAY: 30
  IMAGE_TAG: ${CURATOR_IMAGE_TAG:-5.6.0}
  ELASTIC_NET_NAME: elastic6-net
  SERVICE: elastic_curator

services:
  - docker:dind
# Curator deployment

deploy-curator-supporting-branch-develop:
  stage: deploy
.deploy-curator:
  variables: &deploy-curator-variables
    SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME}

.deploy-curator-development:
  extends: .deploy-development
  variables:
    SSH_REMOTE: ${DEV_SSH_REMOTE}
    SERVICES_TO_CHECK: elastic_curator
    COMPOSE_FILE: docker-compose.curator.tmpl.yml:docker-compose.curator.dev.yml
    ELASTICSEARCH_AUTH: ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}
    DELETE_OLD_LOGS_DISABLE: 'False'
    SNAPSHOT_DISABLE: 'True'
    DELETE_OLD_SNAPSHOTS_DISABLE: 'True'
  script:
    - >
      deploy.sh IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      ELASTICSEARCH_URL=${ELASTICSEARCH_URL} ELASTICSEARCH_AUTH=${ELASTICSEARCH_AUTH}
      DELETE_OLD_LOGS_DISABLE=${DELETE_OLD_LOGS_DISABLE} SNAPSHOT_DISABLE=${SNAPSHOT_DISABLE}
      DELETE_OLD_SNAPSHOTS_DISABLE=${DELETE_OLD_SNAPSHOTS_DISABLE} LOG_INDEX_PREFIX=${LOG_INDEX_PREFIX}
      DELETE_OLD_LOGS_TIMESTRING=${DELETE_OLD_LOGS_TIMESTRING} DELETE_OLD_LOGS_MONTHS_COUNT=${DELETE_OLD_LOGS_MONTHS_COUNT}
      SNAPSHOT_REPOSITORY=${SNAPSHOT_REPOSITORY} DELETE_OLD_SNAPSHOTS_DAYS_COUNT=${DELETE_OLD_SNAPSHOTS_DAYS_COUNT}
    COMPOSE_FILE: docker-compose.${CI_PROJECT_NAME}.tmpl.yml:docker-compose.${CI_PROJECT_NAME}.dev.yml
    <<: *deploy-curator-variables
  environment:
    name: dev/curator
  only:
    - branches
  except:
    - master
    - schedules
    - web
  when: manual
    name: dev/${CI_PROJECT_NAME}

deploy-curator-stable-branch-develop:
  stage: deploy
.deploy-curator-production:
  extends: .deploy-production
  variables:
    SSH_REMOTE: ${DEV_SSH_REMOTE}
    SERVICES_TO_CHECK: elastic_curator
    COMPOSE_FILE: docker-compose.curator.tmpl.yml:docker-compose.curator.dev.yml
    ELASTICSEARCH_AUTH: ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}
    DELETE_OLD_LOGS_DISABLE: 'False'
    SNAPSHOT_DISABLE: 'True'
    DELETE_OLD_SNAPSHOTS_DISABLE: 'True'
  script:
    - >
      deploy.sh IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      ELASTICSEARCH_URL=${ELASTICSEARCH_URL} ELASTICSEARCH_AUTH=${ELASTICSEARCH_AUTH}
      DELETE_OLD_LOGS_DISABLE=${DELETE_OLD_LOGS_DISABLE} SNAPSHOT_DISABLE=${SNAPSHOT_DISABLE}
      DELETE_OLD_SNAPSHOTS_DISABLE=${DELETE_OLD_SNAPSHOTS_DISABLE} LOG_INDEX_PREFIX=${LOG_INDEX_PREFIX}
      DELETE_OLD_LOGS_TIMESTRING=${DELETE_OLD_LOGS_TIMESTRING} DELETE_OLD_LOGS_MONTHS_COUNT=${DELETE_OLD_LOGS_MONTHS_COUNT}
      SNAPSHOT_REPOSITORY=${SNAPSHOT_REPOSITORY} DELETE_OLD_SNAPSHOTS_DAYS_COUNT=${DELETE_OLD_SNAPSHOTS_DAYS_COUNT}
    COMPOSE_FILE: docker-compose.${CI_PROJECT_NAME}.tmpl.yml:docker-compose.${CI_PROJECT_NAME}.prod.yml
    <<: *deploy-curator-variables
  environment:
    name: dev/curator
  only:
    - master
  except:
    - schedules
    - web
    name: pro/${CI_PROJECT_NAME}

.deploy-curator-support-branch: &deploy-curator-support-branch
  rules:
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_COMMIT_TAG ||
          $CI_PIPELINE_SOURCE == "schedule" ||
          $CI_PIPELINE_SOURCE == "web" ||
          $CI_COMMIT_BRANCH == "master"
      when: never
    - if: $CI_COMMIT_BRANCH
      when: manual
      allow_failure: true

deploy-curator-supporting-branch-production:
  stage: deploy
  variables:
    SSH_REMOTE: ${PRO_SSH_REMOTE}
    SERVICES_TO_CHECK: elastic_curator
    COMPOSE_FILE: docker-compose.curator.tmpl.yml:docker-compose.curator.prod.yml
    ELASTICSEARCH_AUTH: ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}
    DELETE_OLD_LOGS_DISABLE: 'False'
    SNAPSHOT_DISABLE: 'False'
    DELETE_OLD_SNAPSHOTS_DISABLE: 'False'
  script:
    - >
      deploy.sh IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      ELASTICSEARCH_URL=${ELASTICSEARCH_URL} ELASTICSEARCH_AUTH=${ELASTICSEARCH_AUTH}
      DELETE_OLD_LOGS_DISABLE=${DELETE_OLD_LOGS_DISABLE} SNAPSHOT_DISABLE=${SNAPSHOT_DISABLE}
      DELETE_OLD_SNAPSHOTS_DISABLE=${DELETE_OLD_SNAPSHOTS_DISABLE} LOG_INDEX_PREFIX=${LOG_INDEX_PREFIX}
      DELETE_OLD_LOGS_TIMESTRING=${DELETE_OLD_LOGS_TIMESTRING} DELETE_OLD_LOGS_MONTHS_COUNT=${DELETE_OLD_LOGS_MONTHS_COUNT}
      SNAPSHOT_REPOSITORY=${SNAPSHOT_REPOSITORY} DELETE_OLD_SNAPSHOTS_DAYS_COUNT=${DELETE_OLD_SNAPSHOTS_DAYS_COUNT}
  environment:
    name: pro/curator
  only:
    - branches
  except:
    - master
    - schedules
    - web
deploy-curator-support-branch-development:
  extends: .deploy-curator-development
  <<: *deploy-curator-support-branch

.deploy-curator-stable-branch: &deploy-curator-stable-branch
  rules:
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_COMMIT_TAG ||
          $CI_PIPELINE_SOURCE == "schedule" ||
          $CI_PIPELINE_SOURCE == "web"
      when: never
    - if: $CI_COMMIT_BRANCH == "master"
      when: manual
      allow_failure: true

deploy-curator-stable-branch-development:
  extends: .deploy-curator-development
  <<: *deploy-curator-stable-branch

deploy-curator-stable-branch-production:
  stage: deploy
  variables:
    SSH_REMOTE: ${PRO_SSH_REMOTE}
    SERVICES_TO_CHECK: elastic_curator
    COMPOSE_FILE: docker-compose.curator.tmpl.yml:docker-compose.curator.prod.yml
    ELASTICSEARCH_AUTH: ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}
    DELETE_OLD_LOGS_DISABLE: 'False'
    SNAPSHOT_DISABLE: 'False'
    DELETE_OLD_SNAPSHOTS_DISABLE: 'False'
  script:
    - >
      deploy.sh IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      ELASTICSEARCH_URL=${ELASTICSEARCH_URL} ELASTICSEARCH_AUTH=${ELASTICSEARCH_AUTH}
      DELETE_OLD_LOGS_DISABLE=${DELETE_OLD_LOGS_DISABLE} SNAPSHOT_DISABLE=${SNAPSHOT_DISABLE}
      DELETE_OLD_SNAPSHOTS_DISABLE=${DELETE_OLD_SNAPSHOTS_DISABLE} LOG_INDEX_PREFIX=${LOG_INDEX_PREFIX}
      DELETE_OLD_LOGS_TIMESTRING=${DELETE_OLD_LOGS_TIMESTRING} DELETE_OLD_LOGS_MONTHS_COUNT=${DELETE_OLD_LOGS_MONTHS_COUNT}
      SNAPSHOT_REPOSITORY=${SNAPSHOT_REPOSITORY} DELETE_OLD_SNAPSHOTS_DAYS_COUNT=${DELETE_OLD_SNAPSHOTS_DAYS_COUNT}
  environment:
    name: pro/curator
  only:
    - master
  except:
    - schedules
    - web
  extends: .deploy-curator-production
  <<: *deploy-curator-stable-branch

.deploy-curator-tag: &deploy-curator-tag
  rules:
    - if: $CI_COMMIT_TAG
      when: manual
      allow_failure: true

scheduled-run-curator-develop:
  stage: maintenance
  variables:
    SSH_REMOTE: ${DEV_SSH_REMOTE}
  script: relaunch.sh
  only:
    - schedules
deploy-curator-tag-development:
  extends: .deploy-curator-development
  <<: *deploy-curator-tag

scheduled-run-curator-production:
  stage: maintenance
  variables:
    SSH_REMOTE: ${PRO_SSH_REMOTE}
  script: relaunch.sh
  only:
    - schedules
deploy-curator-tag-production:
  extends: .deploy-curator-production
  <<: *deploy-curator-tag

# El siguiente job es temporal, hasta que se unifiquen elasticsearch v5 y v6
scheduled-run-old-curator-production:
  stage: maintenance
# Curator-restore deployment

.deploy-curator-restore:
  variables: &deploy-curator-restore-variables
    SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME}-restore

.deploy-curator-restore-development:
  extends: .deploy-development
  variables:
    SSH_REMOTE: ${PRO_SSH_REMOTE}
    SERVICE: elastic_old-curator
  script: relaunch.sh
  only:
    - schedules

deploy-curator-restore-develop:
  stage: deploy
    COMPOSE_FILE: docker-compose.${CI_PROJECT_NAME}-restore.tmpl.yml:docker-compose.${CI_PROJECT_NAME}-restore.dev.yml
    <<: *deploy-curator-restore-variables
  environment:
    name: dev/${CI_PROJECT_NAME}-restore

.deploy-curator-restore-production:
  extends: .deploy-production
  variables:
    SSH_REMOTE: ${DEV_SSH_REMOTE}
    SERVICES_TO_CHECK: elastic_curator-restore
    COMPOSE_FILE: docker-compose.curator-restore.tmpl.yml:docker-compose.curator-restore.dev.yml
    ELASTICSEARCH_AUTH: ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}
  script:
    - >
      deploy.sh IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      ELASTICSEARCH_URL=${ELASTICSEARCH_URL} ELASTICSEARCH_AUTH=${ELASTICSEARCH_AUTH}
      SNAPSHOT_REPOSITORY=${SNAPSHOT_REPOSITORY} SNAPSHOT_RESTORE_NAME=${SNAPSHOT_RESTORE_NAME}
      SNAPSHOT_RESTORE_INDICES=${SNAPSHOT_RESTORE_INDICES} ELASTIC_NET_NAME=${ELASTIC_NET_NAME}
    COMPOSE_FILE: docker-compose.${CI_PROJECT_NAME}-restore.tmpl.yml:docker-compose.${CI_PROJECT_NAME}-restore.prod.yml
    <<: *deploy-curator-restore-variables
  environment:
    name: dev/curator-restore
  only:
    - web
    name: pro/${CI_PROJECT_NAME}-restore

.deploy-curator-restore-support-branch: &deploy-curator-restore-support-branch
  rules:
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_COMMIT_TAG ||
          $CI_PIPELINE_SOURCE == "schedule" ||
          $CI_COMMIT_BRANCH == "master"
      when: never
    - if: $CI_COMMIT_BRANCH &&
          $CI_PIPELINE_SOURCE == "web"
      when: manual
      allow_failure: true

deploy-curator-restore-production:
  stage: deploy
deploy-curator-restore-support-branch-development:
  extends: .deploy-curator-restore-development
  <<: *deploy-curator-restore-support-branch

.deploy-curator-restore-stable-branch: &deploy-curator-restore-stable-branch
  rules:
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_COMMIT_TAG ||
          $CI_PIPELINE_SOURCE == "schedule"
      when: never
    - if: $CI_COMMIT_BRANCH == "master" &&
          $CI_PIPELINE_SOURCE == "web"
      when: manual
      allow_failure: true

deploy-curator-restore-stable-branch-development:
  extends: .deploy-curator-restore-development
  <<: *deploy-curator-restore-stable-branch

deploy-curator-restore-stable-branch-production:
  extends: .deploy-curator-restore-production
  <<: *deploy-curator-restore-stable-branch

# Old-curator deployment
# Jobs temporales, hasta unificar Elasticsearch v5 y v6

.deploy-old-curator:
  variables: &deploy-old-curator-variables
    SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_old-${CI_PROJECT_NAME}

.deploy-old-curator-development:
  extends: .deploy-development
  variables:
    SSH_REMOTE: ${PRO_SSH_REMOTE}
    SERVICES_TO_CHECK: elastic_curator-restore
    COMPOSE_FILE: docker-compose.curator-restore.tmpl.yml:docker-compose.curator-restore.prod.yml
    ELASTICSEARCH_AUTH: ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}
  script:
    - >
      deploy.sh IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      ELASTICSEARCH_URL=${ELASTICSEARCH_URL} ELASTICSEARCH_AUTH=${ELASTICSEARCH_AUTH}
      SNAPSHOT_REPOSITORY=${SNAPSHOT_REPOSITORY} SNAPSHOT_RESTORE_NAME=${SNAPSHOT_RESTORE_NAME}
      SNAPSHOT_RESTORE_INDICES=${SNAPSHOT_RESTORE_INDICES} ELASTIC_NET_NAME=${ELASTIC_NET_NAME}
    COMPOSE_FILE: docker-compose.old-${CI_PROJECT_NAME}.tmpl.yml:docker-compose.old-${CI_PROJECT_NAME}.dev.yml
    <<: *deploy-old-curator-variables
  environment:
    name: pro/curator-restore
  only:
    - web
  when: manual
    name: dev/old-${CI_PROJECT_NAME}

# El siguiente job es temporal, hasta que se unifiquen elasticsearch v5 y v6
deploy-old-curator-supporting-branch-production:
  stage: deploy
.deploy-old-curator-production:
  extends: .deploy-production
  variables:
    SSH_REMOTE: ${PRO_SSH_REMOTE}
    SERVICES_TO_CHECK: elastic_old-curator
    COMPOSE_FILE: docker-compose.old-curator.tmpl.yml:docker-compose.old-curator.prod.yml
    ELASTICSEARCH_URL: http://es-1
    SNAPSHOT_DISABLE: 'False'
    DELETE_OLD_LOGS_DISABLE: 'True'
    DELETE_OLD_SNAPSHOTS_DISABLE: 'True'
  script:
    - >
      deploy.sh IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE} ELASTICSEARCH_URL=${ELASTICSEARCH_URL}
      DELETE_OLD_LOGS_DISABLE=${DELETE_OLD_LOGS_DISABLE} SNAPSHOT_DISABLE=${SNAPSHOT_DISABLE}
      DELETE_OLD_SNAPSHOTS_DISABLE=${DELETE_OLD_SNAPSHOTS_DISABLE} SNAPSHOT_REPOSITORY=${SNAPSHOT_REPOSITORY}
    COMPOSE_FILE: docker-compose.old-${CI_PROJECT_NAME}.tmpl.yml:docker-compose.old-${CI_PROJECT_NAME}.prod.yml
    <<: *deploy-old-curator-variables
  environment:
    name: pro/old-curator
  only:
    - branches
  except:
    - master
    - schedules
    - web
    name: pro/old-${CI_PROJECT_NAME}

.deploy-old-curator-support-branch: &deploy-old-curator-support-branch
  rules:
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_COMMIT_TAG ||
          $CI_PIPELINE_SOURCE == "schedule" ||
          $CI_PIPELINE_SOURCE == "web" ||
          $CI_COMMIT_BRANCH == "master"
      when: never
    - if: $CI_COMMIT_BRANCH
      when: manual
      allow_failure: true

deploy-old-curator-support-branch-development:
  extends: .deploy-old-curator-development
  <<: *deploy-old-curator-support-branch

.deploy-old-curator-stable-branch: &deploy-old-curator-stable-branch
  rules:
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_COMMIT_TAG ||
          $CI_PIPELINE_SOURCE == "schedule" ||
          $CI_PIPELINE_SOURCE == "web"
      when: never
    - if: $CI_COMMIT_BRANCH == "master"
      when: manual
      allow_failure: true

deploy-old-curator-stable-branch-development:
  extends: .deploy-old-curator-development
  <<: *deploy-old-curator-stable-branch

deploy-old-curator-stable-branch-production:
  extends: .deploy-old-curator-production
  <<: *deploy-old-curator-stable-branch

# Maintenance

.scheduled-run:
  variables:
    STACK: ${PROJECT_PARENT_NAME}
    SERVICE: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME}

# Job temporal, hasta unificar Elasticsearch v5 y v6
scheduled-run-old-curator-production:
  extends: scheduled-run-production
  variables:
    SERVICE: ${PROJECT_PARENT_NAME}_old-${CI_PROJECT_NAME}
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
In order to restore Elasticsearch indices, you must create a new pipeline to deploy 'curator-restore' service.
Define these environment variables to configure manual pipeline:

* **SNAPSHOT_RESTORE_NAME**: Snapshot source name to restore indices. Leave it empty to use last snapshot.
* **SNAPSHOT_RESTORE_INDICES**: Name/expression to filter indices to restore. Accepts wildcards.
* **DD_SNAPSHOT_RESTORE_NAME**: Snapshot source name to restore indices. Leave it empty to use last snapshot.
* **DD_SNAPSHOT_RESTORE_INDICES**: Name/expression to filter indices to restore. Accepts wildcards.

Then, you can run deploy task manually.
+11 −1
Original line number Diff line number Diff line
ELASTICSEARCH_URL=http://elasticsearch
ELASTICSEARCH_AUTH=user:pass
ES_USER=user
ES_PASS=pass
ELASTICSEARCH_PORT=9200
CURATOR_TIMEOUT=60
LOG_INDEX_PREFIX=fluentd-
@@ -14,3 +15,12 @@ DELETE_OLD_LOGS_DISABLE=False
SNAPSHOT_DISABLE=False
DELETE_OLD_SNAPSHOTS_DISABLE=False
RESTORE_SNAPSHOT_DISABLE=True

CURATOR_CONFIG_PATH=/.curator/curator.yml
CURATOR_ACTIONS_PATH=/.curator/actions.yml

ELASTIC_NET_NAME=elastic6-net
ELASTIC_NET_DRIVER=overlay

CURATOR_CONFIG_CONFIG_NAME=curator-config
CURATOR_ACTIONS_CONFIG_NAME=curator-actions
+28 −24
Original line number Diff line number Diff line
@@ -2,50 +2,54 @@ version: '3.5'

services:
  curator-restore:
    image: bobrik/curator:${IMAGE_TAG:-latest}
    command: /.curator/actions.yml
    image: ${IMAGE_NAME:-bobrik/curator}:${IMAGE_TAG:-latest}
    command: ${CURATOR_ACTIONS_PATH}
    environment:
      - ELASTICSEARCH_URL
      - ELASTICSEARCH_AUTH
      - ELASTICSEARCH_PORT
      - CURATOR_TIMEOUT
      - SNAPSHOT_REPOSITORY
      - SNAPSHOT_RESTORE_NAME
      - SNAPSHOT_RESTORE_INDICES
      - SNAPSHOT_RESTORE_INCLUDE_ALIASES
      - DELETE_OLD_LOGS_DISABLE=True
      - SNAPSHOT_DISABLE=True
      - DELETE_OLD_SNAPSHOTS_DISABLE=True
      - RESTORE_SNAPSHOT_DISABLE=False
      ELASTICSEARCH_URL:
      ELASTICSEARCH_AUTH: ${ES_USER}:${ES_PASS}
      ELASTICSEARCH_PORT:
      CURATOR_TIMEOUT:
      SNAPSHOT_REPOSITORY:
      SNAPSHOT_RESTORE_NAME:
      SNAPSHOT_RESTORE_INDICES:
      SNAPSHOT_RESTORE_INCLUDE_ALIASES:
      DELETE_OLD_LOGS_DISABLE: 'True'
      SNAPSHOT_DISABLE: 'True'
      DELETE_OLD_SNAPSHOTS_DISABLE: 'True'
      RESTORE_SNAPSHOT_DISABLE: 'False'
    networks:
      - elastic-net
      elastic-net:
    configs:
      - source: curator-config
        target: /.curator/curator.yml
        target: ${CURATOR_CONFIG_PATH}
      - source: curator-actions
        target: /.curator/actions.yml
        target: ${CURATOR_ACTIONS_PATH}
    deploy:
      mode: replicated
      replicas: 1
      replicas: ${REPLICAS:-1}
      restart_policy:
        condition: none
      update_config:
        delay: ${UPDATE_DELAY:-1m}
      resources:
        limits:
          cpus: '0.1'
          memory: 64M
          cpus: '${RESOURCES_LIMITS_CPUS:-0.1}'
          memory: ${RESOURCES_LIMITS_MEMORY:-64M}
        reservations:
          memory: 32M
          cpus: '${RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${RESOURCES_RESERVATIONS_MEMORY:-32M}

networks:
  elastic-net:
    name: ${ELASTIC_NET_NAME:-elastic6-net}
    name: ${ELASTIC_NET_NAME}
    driver: ${ELASTIC_NET_DRIVER}
    external: true

configs:
  curator-config:
    name: ${CURATOR_CONFIG_NAME:-curator-config}
    name: ${CURATOR_CONFIG_CONFIG_NAME}
    file: ./config/curator.yml

  curator-actions:
    name: ${CURATOR_ACTIONS_NAME:-curator-actions}
    name: ${CURATOR_ACTIONS_CONFIG_NAME}
    file: ./config/actions.yml
+29 −26
Original line number Diff line number Diff line
@@ -3,52 +3,55 @@ version: '3.5'
services:
  curator:
    image: ${IMAGE_NAME:-bobrik/curator}:${IMAGE_TAG:-latest}
    command: /.curator/actions.yml
    command: ${CURATOR_ACTIONS_PATH}
    environment:
      - ELASTICSEARCH_URL
      - ELASTICSEARCH_AUTH
      - ELASTICSEARCH_PORT
      - CURATOR_TIMEOUT
      - LOG_INDEX_PREFIX
      - DELETE_OLD_LOGS_TIMESTRING
      - DELETE_OLD_LOGS_MONTHS_COUNT
      - SNAPSHOT_REPOSITORY
      - DELETE_OLD_SNAPSHOTS_DAYS_COUNT
      - DELETE_OLD_LOGS_DISABLE
      - SNAPSHOT_DISABLE
      - DELETE_OLD_SNAPSHOTS_DISABLE
      - RESTORE_SNAPSHOT_DISABLE
      ELASTICSEARCH_URL:
      ELASTICSEARCH_AUTH: ${ES_USER}:${ES_PASS}
      ELASTICSEARCH_PORT:
      CURATOR_TIMEOUT:
      LOG_INDEX_PREFIX:
      DELETE_OLD_LOGS_TIMESTRING:
      DELETE_OLD_LOGS_MONTHS_COUNT:
      SNAPSHOT_REPOSITORY:
      DELETE_OLD_SNAPSHOTS_DAYS_COUNT:
      DELETE_OLD_LOGS_DISABLE:
      SNAPSHOT_DISABLE:
      DELETE_OLD_SNAPSHOTS_DISABLE:
      RESTORE_SNAPSHOT_DISABLE:
    networks:
      - elastic-net
      elastic-net:
    configs:
      - source: curator-config
        target: /.curator/curator.yml
        target: ${CURATOR_CONFIG_PATH}
      - source: curator-actions
        target: /.curator/actions.yml
        target: ${CURATOR_ACTIONS_PATH}
    deploy:
      mode: replicated
      replicas: 1
      replicas: ${REPLICAS:-1}
      restart_policy:
        condition: on-failure
        delay: 10s
        window: 1m
        delay: ${RESTART_DELAY:-10s}
      update_config:
        delay: ${UPDATE_DELAY:-1m}
      resources:
        limits:
          cpus: '0.1'
          memory: 64M
          cpus: '${RESOURCES_LIMITS_CPUS:-0.1}'
          memory: ${RESOURCES_LIMITS_MEMORY:-64M}
        reservations:
          memory: 32M
          cpus: '${RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${RESOURCES_RESERVATIONS_MEMORY:-32M}

networks:
  elastic-net:
    name: ${ELASTIC_NET_NAME:-elastic6-net}
    name: ${ELASTIC_NET_NAME}
    driver: ${ELASTIC_NET_DRIVER}
    external: true

configs:
  curator-config:
    name: ${CURATOR_CONFIG_NAME:-curator-config}
    name: ${CURATOR_CONFIG_CONFIG_NAME}
    file: ./config/curator.yml

  curator-actions:
    name: ${CURATOR_ACTIONS_NAME:-curator-actions}
    name: ${CURATOR_ACTIONS_CONFIG_NAME}
    file: ./config/actions.yml
Loading