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

Load image policies from all namespaces. #151

Conversation

vladlosev
Copy link

This PR allows the image update automation to apply image update policies from namespaces other than its own, as a quick way of implementing #85. This is done by loading the policies for consideration from all namespaces rather than from just the automation's own namespace.

In our company we have multiple semi-independent teams working on different
projects in our cluster and a single infrastructure team managing the
infrastructure for them, including the cluster itself. For the purposes of
data protection we have to keep the teams isolated, so each team has a
namespace it controls, and the infrastructure team runs the system namespaces,
including flux-system, where the repository and image automation CRDs are
defined. The individual teams control the exact set of images they generate
and push and the image selection criteria for deployment so we want to allow
them to manage the ImageRepository and ImageUpdatePolicy in their
namespaces. But with the GitRepository and ImageUpdateAutomation residing
in flux-system, they can't, unless ImageUpdateAutomation can handle policies
from other namespaces.

Signed-off-by: Vlad Losev <vladimir.losev@sage.com>
@vladlosev vladlosev force-pushed the misc-load-image-policies-from-all-namespaces branch from 3d636d7 to 0ccd0b6 Compare April 15, 2021 23:32
@stefanprodan
Copy link
Member

stefanprodan commented Apr 16, 2021

@vladlosev thanks for taking the time to open this PR, but in its current form, we can’t accept such a change that would break everyone’s setups. A better way of doing this, without changing the default behavior, would be to introduce a namespace label selector in the API spec.

@vladlosev
Copy link
Author

Hmm, I see what you mean - you want explicit control over which ImageUpdateAutomation applies any given ImageUpdatePolicy and you lose that control with this patch. Too bad I didn't catch that issue earlier. :-(

I could try my hand at the API change. When you talk about the API change are you talking about one of the two approaches mentioned in #85 (comment)? If so, which one?

@vladlosev
Copy link
Author

Closing in favor of #157.

@vladlosev vladlosev closed this Apr 23, 2021
@vladlosev vladlosev deleted the misc-load-image-policies-from-all-namespaces branch April 23, 2021 14:55
@squaremo
Copy link
Member

squaremo commented May 5, 2021

@vladlosev Would it also work to define the ImageUpdateAutomation object in the user's namespace, and be able to refer to a GitRepository defined centrally?

@vladlosev
Copy link
Author

@squaremo certainly. I'd be happy to use cross-namespace GitRepository references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants