Repository navigation
Conversation
The operator indexes and watches namespaced resources (including
Secret, ConfigMap, Deployment, DaemonSet, Service, PodDisruptionBudget,
Pod, Lease, EndpointSlice, Prometheus, ServiceMonitor, and
VerticalPodAutoscaler) through controller-runtime's shared cache to
reconcile KAIConfig and SchedulingShard operands. Previously only Pod,
Lease, and EndpointSlice were restricted to the KAI namespace in
cache.Options.ByObject, causing the operator to list and watch
cluster-wide Secrets (including Helm release secrets) and other
namespaced objects across all namespaces.
Configure DefaultNamespaces in NewCacheOptions so every namespaced
resource is scoped to the KAI namespace by default (falling back to
constants.DefaultKAINamespace when empty), while cluster-scoped
resources continue to use the cluster cache. Exempt only ServiceAccount
in ByObject with cache.AllNamespaces because the binder and
node-scale-adjuster operands also reconcile ServiceAccounts in their
dedicated resource-reservation and scale-adjust namespaces.
Also update the operator --namespace flag default from "runai-engine"
to constants.DefaultKAINamespace ("kai-scheduler") to match
kaiv1.ConfigSpec.SetDefaultsWhereNeeded() and the scheduler options.
(cherry picked from commit 57db87d)
Signed-off-by: Gregory Giecold <ggiecold@nvidia.com>
enoodle
approved these changes
Nov 20, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #2676 to
v0.18.Problems
v0.18,cmd/operator/app/app.goscopes onlyPod,Lease, andEndpointSliceinformers toopts.Namespace, leavingConfigMap,Secret,Deployment,DaemonSet,Service, andPodDisruptionBudgetcached across all namespaces, andcmd/operator/config/options.godefaults--namespaceto"runai-engine".Changes
57db87d8b498e12da9261dbc7174e21485b4cb85(fix(operator): scope owned namespaced resource caches to KAI namespace #2676) ontov0.18, resolving the pre-split package imports (github.com/kai-scheduler/KAI-scheduler/pkg/common/constantsandgithub.com/kai-scheduler/KAI-scheduler/pkg/apis/kai/v1).Things to note
DefaultNamespacestoopts.Namespace("kai-scheduler"by default) with a singleByObjectexemption forServiceAccount(cache.AllNamespaces).