Open EdKingscote opened 3 months ago
Possible duplicate of https://github.com/rancher/fleet/issues/2262
@manno I'm interested in namespaceAnnotations as a targetCustomization, but it is very similar to the namespaceLabels one!
Assigning @weyfonk because of ongoing work on https://github.com/rancher/fleet/pull/2664
namespaceLabels
and namespaceAnnotations
, specified as bundle deployment options in fleet.yaml, could only be specified once for all clusters, but could not be overridden on a per-cluster basis.
Both namespaceLabels
and namespaceAnnotations
are now supported in fleet.yaml
's targetCustomizations
.
N/A
End-to-end tests have been added to cover merging of namespace labels and annotations specified at the root of fleet.yaml
(ie for all clusters) with those set (with different keys) within targetCustomizations
. They do not cover:
N/A
N/A
Is your feature request related to a problem?
1627 introduced the ability to have namespaceLabels and namespaceAnnotations as part of the bundle deployment options.
This doesn't quite go far enough, as a single set of values can only be applied to all clusters, which means annotations and labels have to be identical across all environments.
I am specifically after namespaceAnnotations in the targetCustomizations, however I think it makes sense to look at both of these elements together to also resolve #2262 in the same feature given the similarities.
I believe this could also provide a quick path for enabling #304 via static configuration as an interim step too (which is my immediate use-case for this right now)
Solution you'd like
Adding the necessary elements to the fleet.yaml doesn't appear to incur complaint, and from deeper analysis in the codebase, I believe the only missing piece of the jigsaw to enable this is in the merge function? as well as the necessary testing and documentation.
This is only the second time ever that I've attempted to write anything in Go, but this feels close to what the missing code should be?
Alternatives you've considered
I've tried to have my helm chart create the namespace with the appropriate annotations to place in a Rancher project via helm values and
takeOwnership: true
, however whilst the namespace lands correctly, Rancher doesn't assign appropriate permissions for non-administrative users to see everything else in the namespace, which puts me in a tricky spot!I also considered using kustomize, but this suggests it won't work when using helm charts for the applications to be deployed.
For now, I think I'm going to end up with the plethora of
fleet.yaml
files in multiple directories to force split things across my different clusters and work with the top level bundle deployment options.Anything else?
@raulcabello as you did the original work on namespaceLabels/namespaceAnnotations support - I'd value your thoughts and input!