Skip to content

Add feature flag treat-pod-as-always-schedulable#15397

Closed
SaschaSchwarze0 wants to merge 1 commit intoknative:mainfrom
SaschaSchwarze0:sascha-treat-pod-as-always-schedulable
Closed

Add feature flag treat-pod-as-always-schedulable#15397
SaschaSchwarze0 wants to merge 1 commit intoknative:mainfrom
SaschaSchwarze0:sascha-treat-pod-as-always-schedulable

Conversation

@SaschaSchwarze0
Copy link
Contributor

The feature flag allows to declare that Pods in the system will eventually all get scheduled and Revisions should therefore not be marked unschedulable

Fixes #14862

Proposed Changes

Unfortunately, I never got feedback in above issue, so trying with a PR now:

  • New feature treat-pod-as-always-schedulable is added with default Disabled.
  • If enabled, the revision reconciler will skip the check whether a pod is not scheduled and therefore never mark a revision as unschedulable.

Release Note

You can now set the new feature `treat-pod-as-always-schedulable` to enabled in the config-defaults ConfigMap. As a result, Knative will not mark revisions as Unschedulable when a Pod is not scheduled. This makes sense if you want to omit this transient state in clusters that have cluster-autoscaling set up, and you can guarantee that all Pods will be eventually scheduled.

@knative-prow knative-prow bot requested review from dprotaso and izabelacg July 19, 2024 12:30
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 19, 2024
@knative-prow
Copy link

knative-prow bot commented Jul 19, 2024

Hi @SaschaSchwarze0. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@SaschaSchwarze0 SaschaSchwarze0 force-pushed the sascha-treat-pod-as-always-schedulable branch from e5cb758 to 7f8e56d Compare July 19, 2024 13:11
@SaschaSchwarze0
Copy link
Contributor Author

SaschaSchwarze0 commented Jul 19, 2024

Hm, I debugged the failing unit test and can see that when the code checks the config, that there is some config in the context with the right value but somehow what it gets has it empty. Need to check ...

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2024
@SaschaSchwarze0 SaschaSchwarze0 force-pushed the sascha-treat-pod-as-always-schedulable branch from 7f8e56d to b7433df Compare October 17, 2024 11:49
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 17, 2024
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 7, 2025
@dprotaso dprotaso added this to the v1.18 milestone Jan 14, 2025
@skonto
Copy link
Contributor

skonto commented Jan 14, 2025

@SaschaSchwarze0 gentle ping.

@skonto
Copy link
Contributor

skonto commented Jan 14, 2025

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 14, 2025
@SaschaSchwarze0 SaschaSchwarze0 force-pushed the sascha-treat-pod-as-always-schedulable branch from b7433df to 871e63a Compare January 14, 2025 12:35
@knative-prow
Copy link

knative-prow bot commented Jan 14, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: SaschaSchwarze0
Once this PR has been reviewed and has the lgtm label, please assign dprotaso for approval. For more information see the Code Review Process.

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

Details 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

@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 14, 2025
@SaschaSchwarze0
Copy link
Contributor Author

SaschaSchwarze0 commented Jan 14, 2025

@SaschaSchwarze0 gentle ping.

Rebased, but I still do not understand the unit test case failure in pkg/reconciler/revision/table_test.go. In particular, the custom context with the custom feature flag does not work = the code does not get the expected feature flag status and I do not understand why.

EDIT1: I think I now understand it. table_test.go does the following which overwrites all config customizations done on the Ctx of the row.

		return revisionreconciler.NewReconciler(ctx, logging.FromContext(ctx), servingclient.Get(ctx),
			listers.GetRevisionLister(), controller.GetEventRecorder(ctx), r,
			controller.Options{
				ConfigStore: &testConfigStore{
					config: reconcilerTestConfig(),
				},
			})

EDIT2: Though, I do not understand why it works for other unit tests then (like the one that sets PodSpecInitContainers to Enabled).

EDIT3: Maybe because only the controller uses the configstore from its options.

EDIT4: Fixed.

@SaschaSchwarze0 SaschaSchwarze0 force-pushed the sascha-treat-pod-as-always-schedulable branch from 871e63a to a022e64 Compare January 14, 2025 13:57
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 14, 2025
@SaschaSchwarze0 SaschaSchwarze0 force-pushed the sascha-treat-pod-as-always-schedulable branch from a022e64 to 7f7abc4 Compare January 14, 2025 15:25
The feature flag allows to declare that Pods in the system will eventually all get scheduled and Revisions should therefore not be marked unschedulable

Signed-off-by: Sascha Schwarze <schwarzs@de.ibm.com>
@SaschaSchwarze0 SaschaSchwarze0 force-pushed the sascha-treat-pod-as-always-schedulable branch from 7f7abc4 to 5303dc0 Compare January 14, 2025 15:29
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 14, 2025
@codecov
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.84%. Comparing base (19b9a09) to head (5303dc0).
⚠️ Report is 213 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15397      +/-   ##
==========================================
+ Coverage   80.78%   80.84%   +0.06%     
==========================================
  Files         222      222              
  Lines       18025    18029       +4     
==========================================
+ Hits        14561    14576      +15     
+ Misses       3092     3084       -8     
+ Partials      372      369       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 18, 2025
@knative-prow-robot
Copy link
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@dprotaso dprotaso modified the milestones: v1.18.0, v1.19.0 Apr 18, 2025
@github-actions
Copy link

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with /reopen. Mark as fresh by adding the
comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 19, 2025
@github-actions github-actions bot closed this Aug 19, 2025
@SaschaSchwarze0
Copy link
Contributor Author

Hm, I missed that this PR was auto-closed. Let me try if I can revive it or need to open a new one.

/reopen

@knative-prow
Copy link

knative-prow bot commented Oct 14, 2025

@SaschaSchwarze0: Failed to re-open PR: state cannot be changed. The sascha-treat-pod-as-always-schedulable branch was force-pushed or recreated.

Details

In response to this:

Hm, I missed that this PR was auto-closed. Let me try if I can revive it or need to open a new one.

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@SaschaSchwarze0
Copy link
Contributor Author

Above PR was closed. But the change in the meantime got included through PR #16146. I do not see this critical enough for a patch, but we can instead adopt it (requires a feature flag being set in config-deployment) when it is included in a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide configuration option for revisions becoming Unschedulable

4 participants