fluent / helm-charts

Helm Charts for Fluentd and Fluent Bit
Apache License 2.0
366 stars 438 forks source link

Create unqiue uid for grafana fluent-bit dashboard #503

Closed captainpro-eng closed 1 month ago

captainpro-eng commented 1 month ago

Conflict in UIDs of Grafana dashboard when running multiple Fluent Bit Helm Release.

Fixes #499 #465

captainpro-eng commented 1 month ago

@edsiper @stevehipwell @naseemkullah please review it.

stevehipwell commented 1 month ago

@captainpro-eng wont this implementation churn the uid with each Helm operation?

captainpro-eng commented 1 month ago

wont this implementation churn the uid with each Helm operation?

didn't get your point. please explain it.

stevehipwell commented 1 month ago

@captainpro-eng the randAlphaNum function would cause the uid to change each time you ran helm upgrade.

To achieve what you're looking at doing I'd suggest using the following function which would be deterministic (assuming the result is a valid type for uid).

{{/*
Create the uid for grafana fluent-bit dashboard
*/}}
{{- define "fluent-bit.dashboard.uid" -}}
{{- sha256sum (printf "%s/%s" .Release.Namespace .Release.Name) }}
{{- end }}
captainpro-eng commented 1 month ago

@captainpro-eng the randAlphaNum function would cause the uid to change each time you ran helm upgrade.

To achieve what you're looking at doing I'd suggest using the following function which would be deterministic (assuming the result is a valid type for uid).

{{/*
Create the uid for grafana fluent-bit dashboard
*/}}
{{- define "fluent-bit.dashboard.uid" -}}
{{- sha256sum (printf "%s/%s" .Release.Namespace .Release.Name) }}
{{- end }}

got it 👍

captainpro-eng commented 1 month ago

@captainpro-eng you will need to update the Chart.yaml to bump the version and change the release note annotations. Could you also squash your commits if possible.

@stevehipwell changes has been added.

stevehipwell commented 1 month ago

@captainpro-eng could you fix the failing DCO?

captainpro-eng commented 1 month ago

@captainpro-eng could you fix the failing DCO?

please review it.

captainpro-eng commented 1 month ago

@captainpro-eng I've just checked the docs and it looks like this behaviour could be achieved by just setting the value to null.

okay let me check

captainpro-eng commented 1 month ago

@captainpro-eng I've just checked the docs and it looks like this behaviour could be achieved by just setting the value to null.

i tested with null values facing same issue "the same UID is used more than once". if we set null it is genrating same uid for all helm release.

stevehipwell commented 1 month ago

i tested with null values facing same issue "the same UID is used more than once". if we set null it is genrating same uid for all helm release.

@captainpro-eng did you also set the id to null?

captainpro-eng commented 1 month ago

i tested with null values facing same issue "the same UID is used more than once". if we set null it is genrating same uid for all helm release.

@captainpro-eng did you also set the id to null?

id is already null.