Overview
Elasticsearch Curator is a useful tool for indices and snapshot lifecycle management. This tool can be installed in a Konvoy cluster by enabling the elasticsearch-curator addon in the cluster.yaml. Please note that elasticsearch should also be enabled.
Configuring Curator actions
The operations that curator can perform on elasticsearch indices are defined as actions in the cluster.yaml. The indices on which these actions are performed are selected by defining filters. Curator can be configured to create and delete indices and snapshots in elasticsearch. These are not the only actions that it can perform; a complete list of the actions that curator can perform on elasticsearch indices can be found here.
By default, in Konvoy this addon is configured to delete indices older than 10 days and that match the following regex pattern:
^(kubernetes_)(audit-|cluster-|host-|host_kernel-).*$
The actions and filters configured in elasticsearch-curator are stored in the elasticsearch-curator-kubeaddons-config configmap in the kubeaddons namespace. Thus, details on which actions and filters are configured can be checked with the following command:
kubectl get cm elasticsearch-curator-kubeaddons-config -n kubeaddons -o jsonpath='{.data}'
An example of how to define curator parameters to delete indices older than 10 days in the cluster.yaml is shown below:
- name: elasticsearch-curator
enabled: true
values: |
configMaps:
# Delete indices older than 7 days
action_file_yml: |-
---
actions:
1:
action: delete_indices
description: "Clean up ES by deleting old indices"
options:
timeout_override:
continue_if_exception: False
disable_action: False
ignore_empty_list: True
filters:
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 7
field:
stats_result:
epoch:
exclude: False