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

[bitnami/external-dns] chart adds podLabels to all resources and can cause duplicates #14542

Open
pinkfloydx33 opened this issue Jan 25, 2023 · 3 comments
Assignees
Labels
external-dns on-hold Issues or Pull Requests with this label will never be considered stale tech-issues The user has a technical issue about an application

Comments

@pinkfloydx33
Copy link

Name and Version

bitnami/external-dns 6.13.1

What steps will reproduce the bug?

Specify any labels in values.podLabels

Are you using any custom parameters or values?

No response

What is the expected behavior?

podLabels should only be added to Pods (via Deployment spec.template.metadata.labels)

What do you see instead?

Pod Labels are treated as "common" labels and when any exist are added to ALL resources (ServiceAccount, Deployment, Cluster Role, etc.)

Additional information

While obviously incorrect, this caused an issue for us during deployment as we have a label that must be specified for both ServiceAccount and Pods. As such, we added the label to both podLabels and serviceAccount.labels. Because they are treated as "common", a duplicate label was added to the ServiceAccount, causing helm to error during deployment

It's due to lines 40-42 here:

{{/* Helm required labels */}}
{{- define "external-dns.labels" -}}
app.kubernetes.io/name: {{ template "external-dns.name" . }}
helm.sh/chart: {{ template "external-dns.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels }}
{{- end }}

The inclusion in external-dns.labels causes the labels to be propogated to all resources, since they all call that template.

Note that this chart already has a commonLabels which is probably what should be in the block above instead:

commonLabels: {}

(however output of commonLabels appears in all the manifest templates individually, not as part of the helper)

The fix is to remove the podLabels from the external-dns.labels template and to incorporate them directly into the Deployment manifest, similar to other labels and annotations

@pinkfloydx33 pinkfloydx33 added the tech-issues The user has a technical issue about an application label Jan 25, 2023
@github-actions github-actions bot added the triage Triage is needed label Jan 25, 2023
@javsalgar javsalgar changed the title external-dns chart adds podLabels to all resources and can cause duplicates [bitnami/external-dns] chart adds podLabels to all resources and can cause duplicates Jan 26, 2023
@javsalgar
Copy link
Contributor

Hi,

Thank you so much for reporting. Would you like to submit a PR fixing the issue?

@github-actions
Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Feb 11, 2023
@pinkfloydx33
Copy link
Author

@javsalgar Sorry for the delayed response. I have been real busy and don't have time to submit a PR right now. I'm also not sure what the appropriate fix would be as I believe the labels are all messed up in general. I think it needs a bit of a rework, but I'm not an expert on these charts....

@github-actions github-actions bot removed the stale 15 days without activity label Feb 12, 2023
@github-actions github-actions bot added on-hold Issues or Pull Requests with this label will never be considered stale and removed triage Triage is needed labels Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-dns on-hold Issues or Pull Requests with this label will never be considered stale tech-issues The user has a technical issue about an application
Projects
None yet
Development

No branches or pull requests

2 participants