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

Sync namespace metadata on creation. #1378

Open
CharlieR-o-o-t opened this issue Feb 16, 2025 · 3 comments · May be fixed by #1379
Open

Sync namespace metadata on creation. #1378

CharlieR-o-o-t opened this issue Feb 16, 2025 · 3 comments · May be fixed by #1379
Labels
blocked-needs-validation Issue need triage and validation

Comments

@CharlieR-o-o-t
Copy link
Contributor

CharlieR-o-o-t commented Feb 16, 2025

We need to sync namespace metadata (labels, annotation and especially nodeSelector) on namespace creation.
For now, namespace nodeSelector reconciled by controller loop and pod can start before nodeSelector will be set on ns (in case of huge amount of namespaces).

Let's add some extra logic to namespace webhook.

*Have prepared PR for this already.

@CharlieR-o-o-t CharlieR-o-o-t added the blocked-needs-validation Issue need triage and validation label Feb 16, 2025
CharlieR-o-o-t added a commit to CharlieR-o-o-t/capsule that referenced this issue Feb 16, 2025
Signed-off-by: Siarhei Rasiukevich <s_rasiukevich@wargaming.net>
CharlieR-o-o-t added a commit to CharlieR-o-o-t/capsule that referenced this issue Feb 16, 2025
Signed-off-by: Siarhei Rasiukevich <s_rasiukevich@wargaming.net>
@prometherion
Copy link
Member

I understand you'd like to deploy Pods as quickly as possible. Still, there's another problem: the RBAC need a Tenant reconciliation, and I don't see the benefit of burdening webhooks further with logic when the Kubernetes way is the eventual consistency.

Happy to hear more about your use case, tho: I've strong opinions, weakly held.

@oliverbaehler what are your thoughts on this?

@CharlieR-o-o-t
Copy link
Contributor Author

The benefits is that pods can started before namespace has node-selector annotation.
We catch these cases on our k8s clusters with high amount of namespaces. Capsule brings nodeSelector after few seconds, during this time lag - pod can be started outside of tenant capacity.

@oliverbaehler
Copy link
Collaborator

I am working on something like a Hook components. Where you can define mutations, validations at admission or in the reconciler. We will drop our strongly typed spec in favour of that. I am with the use, especially PodNodeSelector is a very weak implementation, but i would rather takkle this in a generic way.

CharlieR-o-o-t added a commit to CharlieR-o-o-t/capsule that referenced this issue Mar 5, 2025
Signed-off-by: Siarhei Rasiukevich <s_rasiukevich@wargaming.net>
CharlieR-o-o-t added a commit to CharlieR-o-o-t/capsule that referenced this issue Mar 5, 2025
Signed-off-by: Siarhei Rasiukevich <s_rasiukevich@wargaming.net>
CharlieR-o-o-t added a commit to CharlieR-o-o-t/capsule that referenced this issue Mar 6, 2025
Signed-off-by: Siarhei Rasiukevich <s_rasiukevich@wargaming.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-needs-validation Issue need triage and validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants