Open voidengineer opened 5 years ago
@adamjohnson01 fyi
@voidengineer
When you say add a label to an application, are you referring to the application manifests or their resources? I think it would be a good idea to add labels to the application manifest and use those for matching windows. Currently the sync windows apply to the entire application so it would make sense for the labels to be part of the application manifest. If we wanted to make the sync windows even more granular and allow the ability to selective sync specific resources then labelling the resources would be the way to go but that could get complicated pretty quickly and I am not sure what a use case for that would be.
@adamjohnson01
I meant labels on the application manifest itself, not the individual resources. I agree that the later would be unnecessary complicated.
@voidengineer. That is what I thought, I just wanted to make sure.
I am happy to work on this. I think it is a great idea.
I've reviewed the PR, and wondered if we can build this on top of the existing functionality as follows:
Add an optional field: SyncWindow.Selectors []string
. This is one or more K8S label selector. For a window to match, it must match the namespace, cluster, and selector. This could be combined in two ways:
*
and match everything, but you have a selector than matches across clusters and namespaces.Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Any update on the PR ? I'd love to use that feature on our projects. We have the same use case !
This is still relevant. It would be great to have it.
Summary
The new sync window feature is great! It would be even greater, if applications could not only be selected by name (maybe with wildcard) but also based on their labels.
Motivation
We have a lot of applications that are stateful (primary session-state) that should only be synced at night. It would be great to mark them with a label, say
k8s.example.com/sync-policy: stateful
and apply the matching sync window to it.Proposal
Add a new field
applicationSelector
inspec.syncWindows[]
following the rules for kubernetes label selectors, and match all applications in the project against them.