projectcalico / calico

Cloud native networking and network security
https://docs.tigera.io/calico/latest/about/
Apache License 2.0
6.02k stars 1.34k forks source link

Add custom label to all objects in kubernetes chart #8391

Open TheCubicleJockey opened 10 months ago

TheCubicleJockey commented 10 months ago

Expected Behavior

This chart improvement would allow the user to include a defined label in the value.yaml, and that label would be included in the kubernetes objects in metadata.label where allowed by kubernetes.

Current Behavior

Nothing like this is allowed in this chart.

Possible Solution

Anything that allows user defined labels in the kubernetes objects. Using something like commonLabels at the top level of the values file.

Steps to Reproduce (for bugs)

  1. N/A

Context

Labels are good in kubernetes for organization and for some custom tools that read labels as a part of rule sets.

Your Environment

TheCubicleJockey commented 9 months ago

Am I good to make the PR?

caseydavenport commented 9 months ago

@TheCubicleJockey right now, there is support for podLabels: https://github.com/projectcalico/calico/blob/master/charts/tigera-operator/values.yaml#L49-L50

Would you propose a new field that is merged with podLabels?

TheCubicleJockey commented 9 months ago

My use case is for the clusterrole to have a label. So, I could make one specifically for the clusterrole, but I figured most charts have a values.commonLabels or a values.additionalLabels as a more generally acceptable version that would fit most need and my needs.

If i am doing the work, i would like to help improve the chart in a way that you or your team might like it improved.

caseydavenport commented 9 months ago

Yes, I think values.additionalLabels seems like a a good way to spin this, SGTM!

TheCubicleJockey commented 9 months ago

Made a PR here