[fluent-bit] optional podVersionLabel feature flag to include app.kubernetes.io/version applied to all pods#576
[fluent-bit] optional podVersionLabel feature flag to include app.kubernetes.io/version applied to all pods#576jhulick wants to merge 7 commits intofluent:mainfrom
Conversation
8fc59e1 to
0f788a9
Compare
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks for the PR @jhulick but as was the case for Metrics Server this isn't a desirable change for the chart. If you make this change optional and off by default I think it would be OK; my preference would be to use a value like verbosePodLabels: false.
|
@stevehipwell, I was hesitant to create this PR for that reason, but since fluent-bit is data plane rather than control plane I thought it would be considered acceptable in this case, unless there are other reasons? Is it primarily due to telemetry latency? But I'll update per your proposed suggested. |
460d134 to
aeb9cc3
Compare
|
@jhulick I don't think the labels are a good idea, but even if they were we'd still be looking to follow the "principal of least astonishment"; so making them opt in is the only real way of introducing this change. |
4e7b751 to
dc8b8bd
Compare
|
@jhulick looking at this again with fresh eyes am I right in summarising your requirement as only needing the If we ignore the question of "why"; would the best implementation for this not be to have a |
|
@stevehipwell, yes, only the "...would the best implementation for this not be to have a podVersionLabel: false value which if set to true just adds the singular label?" Yes, I think this is a better approach. I'll update the PR. |
1e9851b to
bc94292
Compare
Signed-off-by: jeremy.hulick <jeremy.hulick@gmail.com>
Signed-off-by: jeremy.hulick <jeremy.hulick@gmail.com>
…nabled in values Signed-off-by: jeremy.hulick <jeremy.hulick@gmail.com>
Signed-off-by: jeremy.hulick <jeremy.hulick@gmail.com>
Signed-off-by: jeremy.hulick <jeremy.hulick@gmail.com>
Signed-off-by: jeremy.hulick <jeremy.hulick@gmail.com>
Signed-off-by: jeremy.hulick <jeremy.hulick@gmail.com>
f979637 to
eb35d7d
Compare
stevehipwell
left a comment
There was a problem hiding this comment.
@jhulick I've added some comments and it looks like you need to rebase this PR locally.
| {{/* | ||
| Verbose Pod labels | ||
| */}} | ||
| {{- define "fluent-bit.podVersionLabel" -}} | ||
| {{ include "fluent-bit.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| {{- end -}} | ||
|
|
There was a problem hiding this comment.
Can this be removed?
| metadata: | ||
| labels: | ||
| {{- include "fluent-bit.selectorLabels" . | nindent 8 }} | ||
| {{- include (ternary "fluent-bit.podVersionLabel" "fluent-bit.selectorLabels" .Values.podVersionLabel) . | nindent 8 }} |
There was a problem hiding this comment.
This would make more sense being below the standard labels and implemented with the following pattern.
{{- if and .Values.podVersionLabel .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
| metadata: | ||
| labels: | ||
| {{- include "fluent-bit.selectorLabels" . | nindent 8 }} | ||
| {{- include (ternary "fluent-bit.podVersionLabel" "fluent-bit.selectorLabels" .Values.podVersionLabel) . | nindent 8 }} |
What this PR does / why we need it:
It adds common labels to metadata labels in the pod spec. The main reasoning is to persist the app.kubernetes.io/version and app.kubernetes.io/name labels to the pod for standardization. Per docs, (https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels) "In order to take full advantage of using these labels, they should be applied on every resource object.".
Improves traceability throughout the application. Ex. via Istio/Kiali dashboard.