camunda / camunda-platform-helm

Camunda Platform 8 Self-Managed Helm charts
https://docs.camunda.io/docs/self-managed/overview/
Apache License 2.0
74 stars 138 forks source link

Add curator as optional deployment #7

Closed Zelldon closed 2 years ago

Zelldon commented 4 years ago

The helm chart should be able to also deploy an curator job like:

CFG Map

[zell zeebe-benchmark/ ns:zell-helm]$ cat setup/curator-configmap.yaml 
apiVersion: v1
kind: ConfigMap
metadata:
  name: curator-config
  labels:
    app: curator
data:
  action_file.yml: |-
    ---
    # Remember, leave a key empty if there is no value.  None will be a string,
    # not a Python "NoneType"
    #
    # Also remember that all examples have 'disable_action' set to True.  If you
    # want to use this action as a template, be sure to set this to False after
    # copying it.
    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: 1
          field:
          stats_result:
          epoch:
          exclude: False
  config.yml: |-
    ---
    # Remember, leave a key empty if there is no value.  None will be a string,
    # not a Python "NoneType"
    client:
      hosts:
        - elasticsearch-master-headless
      port: 9200
      url_prefix:
      use_ssl: False
      certificate:
      client_cert:
      client_key:
      ssl_no_validate: False
      http_auth:
      timeout: 30
      master_only: False
    logging:
      loglevel: INFO
      logfile:
      logformat: default
      blacklist: ['elasticsearch', 'urllib3']

Cronjob

[zell zeebe-benchmark/ ns:zell-helm]$ cat setup/curator-cronjob.yaml 
# https://medium.com/@hagaibarel/running-curator-as-a-kubernetes-cronjob-19eaab9afd3b
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: curator
  labels:
    app: curator
spec:
  schedule: "0 3 * * *" # run every 03:00 AM daily
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 3
  concurrencyPolicy: Forbid
  startingDeadlineSeconds: 120
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - image: bobrik/curator:5.7.6
            name: curator
            args: ["--config", "/etc/config/config.yml", "/etc/config/action_file.yml"]
            volumeMounts:
            - name: config
              mountPath: /etc/config
          volumes:
          - name: config
            configMap:
              name: curator-config
          restartPolicy: OnFailure
Zelldon commented 2 years ago

Seems to be no need from the community yet

falko commented 2 years ago

Today, I had a Camunda Cloud customer asking for guidance on data retention after having 18 months worth of data accumulated and running into limits of the number of indexes and shards in Elasticsearch. So it would be a very useful addition to the Helm charts.

However, the ones from the benchmarks might be too aggressive for production use: https://github.com/camunda-cloud/zeebe/blob/develop/benchmarks/setup/default/curator-configmap.yaml https://github.com/camunda-cloud/zeebe/blob/develop/benchmarks/setup/default/curator-cronjob.yaml

Zelldon commented 2 years ago

supersed by #128