Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esIndexCleaner not working - index-prefix missing in helm chart? #329

Closed
ebini opened this issue Jan 11, 2022 · 8 comments · Fixed by #414
Closed

esIndexCleaner not working - index-prefix missing in helm chart? #329

ebini opened this issue Jan 11, 2022 · 8 comments · Fixed by #414

Comments

@ebini
Copy link

ebini commented Jan 11, 2022

Describe the bug
see jaegertracing/jaeger#3228
the helm chart sets probably something wrong with the prefix or no prefix at all.

I think this has not really been fixed.

To Reproduce

  1. deploy jaeger helm chart with elastic search as storage

(note, i use an "external" ES):

storage:
  type: elasticsearch
  elasticsearch:
    port: "8080"
    scheme: "http"
    host: "my-kibana"
    cmdlineParams:
      es.server-urls: "http://my-kibana:8080"
      es.tls.enabled: false
      es.version: "7"
      es.index-prefix: "jaeger-my-index"
  1. enable index cleaner:
esIndexCleaner:
  enabled: true
  schedule: "4 4 * * *"
  numberOfDays: 1

Expected behavior
should delete old indexes.
it lists the indexes, but don't delete anything.

get in logs:
{"level":"info","ts":1641844868.3567104,"caller":"./main.go:99","msg":"No indices to delete"}

Version (please complete the following information):
current helm chart: version: 0.52.0

Additional context
workaround: if i set manually the prefix with:

esIndexCleaner:
  extraEnv: 
    - name: INDEX_PREFIX
      value: jaeger-my-index

Hope this "quick" bug report is sufficient.
Thanks in advance.

@pavolloffay pavolloffay transferred this issue from jaegertracing/jaeger Jan 13, 2022
@pavolloffay
Copy link
Member

moving to helm chart repository

@mehta-ankit
Copy link
Member

mehta-ankit commented Jan 13, 2022

If there is a prefix on the index you should be passing that extra value to the helm chart to make es-index-cleaner to work , no ?
that is the reason that parameter is available to override:
image

I do not use rollover and have no prefix on my indices and helm chart and es-index-cleaner works fine for me.

@mehta-ankit
Copy link
Member

mehta-ankit commented Jan 13, 2022

Or is the concern that people who use es-index-rollover want the es-index-cleaner to be smart enough to pick up the index prefix ? 🤔
Because by deafult es-rollover is disabled on this helm chart.

esRollover:
  enabled: false

@ebini
Copy link
Author

ebini commented Jan 14, 2022

Hi,
just for clarification what my intension was. (but perhaps I have a misunderstanding).
i forgot the important line in my config and edited at:

i set the prefix here:

storage:
  elasticsearch:
    cmdlineParams:
      es.index-prefix: "jaeger-my-index"

so I would have expected that the environmentvariable/start parameter for
"esIndexCleaner" would than be automatically configured.

took a while to figure out what to do to get it running.
perhaps also only an update in the documentation would be sufficient.
(example in values.yaml and perhaps a short note in the README.md)

Thanks in advance!

@may-cDev
Copy link

I just ran into a similiar issue when trying to let the EsIndexCleaner connect to an Elasticsearch instance via TLS.
When setting the cmdLine parameters via storage configuration or via EsIndexCleaner.cmdlineParams it did not work.
However, when instead setting those values via EsIndexCleaner.extraEnv as you described in your workaround, it works fine.

The storage configuration looks as follows:

storage:
  elasticsearch:
    cmdlineParams:
      es.tls.enabled: true
      es.tls.ca: /tls/cert.pem

The configuration of the extra environment parameters as follows:

extraEnv:
  - name: ES_TLS
    value: "true"
  - name: ES_TLS_CA
    value: /tls/cert.pem

I guess the problem with this is, that the template of the EsIndexCleaner does not evaluate the cmdLineParams at all.
When comparing the EsIndexCleaner as example with the collector-deploy template, the collector template evaluates the cmdLineArguments in the following lines (if understood correctly):

args:
  {{- range $key, $value := .Values.collector.cmdlineParams -}}
  {{- if $value }}
  - --{{ $key }}={{ $value }}
  {{- else }}
  - --{{ $key }}
  {{- end }}
  {{- end -}}
  {{- if not .Values.ingester.enabled -}}
  {{- include "storage.cmdArgs" . | nindent 10 }}
  {{- end }}

However in the the EsIndexCleaner template it looks like that:

args:
  - {{ .Values.esIndexCleaner.numberOfDays | quote }}
  - {{ include "elasticsearch.client.url" . }}

I think, both of our issues would get fixed if the cmdLineArguments would be correctly evaluated in the EsIndexCleaner template, just as they are done in the collector-deploy template (and also others.)

Any opinions on that? Is there an open issue or am I on the wrong track?

@mehta-ankit
Copy link
Member

@may-cDev Thanks for your response. I would have to understand es-index cleaner a bit better to see if it can take all the same cmdlineParams as storage ES. But I can see what you say makes sense.
@naseemkullah @pavelnikolov Thoughts ?

@pavelnikolov
Copy link
Contributor

I believe that we can pass extra command line args to the cleaner and indeed it would solve the issue.

@mehta-ankit
Copy link
Member

@may-cDev Would you be willing to make a contribution 😃 ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants