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

Introduce scope configuration for internal caches #133

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

a-hilaly
Copy link
Member

This patch enhances the runtime internal caches by introducing a
configuration mechanism to tailor their behavior. The caches can now be
configured to watch a specific set of namespaces (instead of the
previous "all or nothing" style).

This is intended to be complete the multi-namspace-watch mode feature.
Now when a user configures a controller to watch a set of namespaces the
ACK runtime caches will also respect that scope.

In addition this commit adds kube-node-lease to the set of namespace
ignored by default (This namespace is dedicated to node Leases objects).

Signed-off-by: Amine Hilaly hilalyamine@gmail.com

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from jlbutler and jljaco January 18, 2024 05:44
@ack-prow ack-prow bot added the approved label Jan 18, 2024
@a-hilaly a-hilaly added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 18, 2024
@a-hilaly
Copy link
Member Author

cc @acornett21

// NOTE: Maybe we should make this configurable? It's not clear that
// we'd ever want to watch these namespaces.
Ignored: []string{
"ack-system",
Copy link
Contributor

@acornett21 acornett21 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to go down the path of hiding what is ignored? It gets into a slippery slope. Maybe for some kube namespaces, but I don't think ack-system should be ignored. There are probably users out there that are creating CR's in this namespace since it's the default namespace that the controller runs in.

Edit: It looks like we sort of already had this, just in a different part of the code, which seems odd to me, but I guess because the implementation was that each NS has it's own cache.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we added cross-account resource management to ACK, the caches ignored to the ack-system namespace (or the namespace where the controller is running). Still, the controller will handle resources in that namespace using the controller role. This means that only CARM will not work on ack-system.

Now, looking at the bigger picture, I agree it might be a bit odd, but we might just allow it since there don't seem to be any issues.. and it won't have any side effects

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't think it's a good idea to expose this level of configuration at the helm/flag level of controllers. However i'm down to remove ack-system from the ignored list and only leave kube-system, kube-public and kube-node-lease.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't think it's a good idea to expose this level of configuration at the helm/flag level of controllers. However i'm down to remove ack-system from the ignored list and only leave kube-system, kube-public and kube-node-lease.

I also do not thing adding a configuration for this is needed, that would add more work/confusion and we'd need to change some documentation.

@a-hilaly a-hilaly removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 19, 2024
@a-hilaly
Copy link
Member Author

/hold

@ack-prow ack-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 19, 2024
Copy link
Member

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2024
@ack-prow ack-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2024
This patch enhances the runtime internal caches by introducing a
configuration mechanism to tailor their behavior. The caches can now be
configured to watch a specific set of namespaces (instead of the
previous "all or nothing" style).

This is intended to be complete the multi-namspace-watch mode feature.
Now when a user configures a controller to watch a set of namespaces the
ACK runtime caches will also respect that scope.

In addition this commit adds `kube-node-lease` to the set of namespace
ignored by default (This namespace is dedicated to node Leases objects).

Signed-off-by: Amine Hilaly <hilalyamine@gmail.com>
@ack-prow ack-prow bot added the do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Jan 19, 2024
@ack-prow ack-prow bot removed the do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Jan 19, 2024
@ack-bot
Copy link
Collaborator

ack-bot commented Jan 19, 2024

/lgtm
/unhold

@ack-prow ack-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 19, 2024
@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2024
Copy link

ack-prow bot commented Jan 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, ack-bot, jonathan-innis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot merged commit 5ce3c59 into aws-controllers-k8s:main Jan 19, 2024
2 checks passed
ndbhat pushed a commit to ndbhat/ack-runtime that referenced this pull request Apr 16, 2024
…s#133)

This patch enhances the runtime internal caches by introducing a
configuration mechanism to tailor their behavior. The caches can now be
configured to watch a specific set of namespaces (instead of the
previous "all or nothing" style).

This is intended to be complete the multi-namspace-watch mode feature.
Now when a user configures a controller to watch a set of namespaces the
ACK runtime caches will also respect that scope.

In addition this commit adds `kube-node-lease` to the set of namespace
ignored by default (This namespace is dedicated to node Leases objects).

Signed-off-by: Amine Hilaly <hilalyamine@gmail.com>

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
4 participants