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

blog: introducing kube-scheduler-simulator #47104

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sanposhiho
Copy link
Member

@sanposhiho sanposhiho commented Jul 6, 2024

This PR adds a blog post to introduce sigs/kube-scheduler-simulator.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 6, 2024
@k8s-ci-robot k8s-ci-robot added the area/blog Issues or PRs related to the Kubernetes Blog subproject label Jul 6, 2024
@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Jul 6, 2024
Copy link

netlify bot commented Jul 6, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 1eb72c9
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/66d7d4c0f06f0c00081a3ba5
😎 Deploy Preview https://deploy-preview-47104--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

title: "Introducing Kube-scheduler-simulator"
date: 2024-07-xx
slug: introducing-kube-scheduler-simulator
canonicalUrl: https://kubernetes.dev/blog/2024/07/xx/introducing-kube-scheduler-simulator/
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for including the canonicalURL here? Is this blog mirrored from the k8s.dev site? If so, review comments should be added to the original content there.

Copy link
Member Author

@sanposhiho sanposhiho Jul 10, 2024

Choose a reason for hiding this comment

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

Sorry, actually I just copied those tags from another blog post.

I saw Kwok's blog post, which I actually copied tags from, have an article in each website.

Would you recommend creating a blog post in kubernetes.dev too? What's the general difference between those two blog websites?

Copy link
Contributor

Choose a reason for hiding this comment

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

https://www.kubernetes.dev/blog/ is aimed only at people contributing to Kubernetes
https://www.kubernetes.io/blog/ is aimed at people using to Kubernetes

Who is this article aimed at? I think people might be using this even though they are not Kubernetes contributors - right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Who is this article aimed at? I think people might be using this even though they are not Kubernetes contributors - right?

Yes, correct. So, here's the place for kubernetes.io blog, right?
Did you suggest making the same post on .dev too? Or, is having it only here fine?

Copy link
Contributor

Choose a reason for hiding this comment

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

This article is in the right repo. No need to change it.

We never mirror from the general website to the contributor website, so there's also no need to open a PR against the contributor site for this article.

@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Jul 10, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

@sanposhiho
Copy link
Member Author

sanposhiho commented Jul 10, 2024

updated to use figure

@Okabe-Junya
Copy link
Member

Okabe-Junya commented Jul 13, 2024

FYI: related issue - #39776

Copy link
Contributor

@nate-double-u nate-double-u left a comment

Choose a reason for hiding this comment

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

a copy-edit pass and some nits:

@sanposhiho
Copy link
Member Author

Addressed the points from @nate-double-u.

Copy link
Contributor

@Ritikaa96 Ritikaa96 left a comment

Choose a reason for hiding this comment

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

nit(optional)

@Ritikaa96
Copy link
Contributor

Ritikaa96 commented Jul 25, 2024

The overall content LGTM. Thanks for the contribution @sanposhiho

@sanposhiho
Copy link
Member Author

Fixed.

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Thanks.

Would you be willing to propose this for https://k8s.dev/blog instead? See https://github.com/kubernetes/contributor-site

@sanposhiho
Copy link
Member Author

Addressed the suggestions from @sftim @network-charles.

@sftim I actually had a question on that topic -

Would you recommend creating a blog post in kubernetes.dev too? What's the general difference between those two blog websites?
#47104 (comment)

Do you mean, we should move it to kubernetes.dev (and do nothing with .io)? Or we should have it on both websites?
(I actually saw Kwok's post is on both websites.)

@sftim
Copy link
Contributor

sftim commented Sep 9, 2024

See #47104 (comment)

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, and please accept our apologies about the long wait for a review.

I hope this feedback comes over as helpful.

The Kubernetes Scheduler is a crucial control plane component that determines which Node a Pod will run on.
Thus, anyone utilizing Kubernetes relies on the scheduler.

[Kube-scheduler-simulator](https://sigs.k8s.io/kube-scheduler-simulator) is a simulator for the Kubernetes scheduler, initially developed by Kensei Nakada as part of [Google Summer of Code 2021](https://summerofcode.withgoogle.com/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Try this:

Suggested change
[Kube-scheduler-simulator](https://sigs.k8s.io/kube-scheduler-simulator) is a simulator for the Kubernetes scheduler, initially developed by Kensei Nakada as part of [Google Summer of Code 2021](https://summerofcode.withgoogle.com/).
The [kube-scheduler-simulator](https://sigs.k8s.io/kube-scheduler-simulator) is a simulator for the Kubernetes scheduler, initially developed by me (Kensei Nakada) as part of [Google Summer of Code 2021](https://summerofcode.withgoogle.com/).

Copy link
Contributor

Choose a reason for hiding this comment

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

As this is a blog article, you can write in the first person, and you are implicitly writing as you.

[Kube-scheduler-simulator](https://sigs.k8s.io/kube-scheduler-simulator) is a simulator for the Kubernetes scheduler, initially developed by Kensei Nakada as part of [Google Summer of Code 2021](https://summerofcode.withgoogle.com/).
This tool allows users to closely examine the scheduler’s behavior and decisions.

It is useful for casual users who employ scheduling constraints (e.g., PodAffinity)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
It is useful for casual users who employ scheduling constraints (e.g., PodAffinity)
It is useful for casual users who employ scheduling constraints (e.g., inter-Pod affinity)

Comment on lines +60 to +83
kind: Pod
apiVersion: v1
metadata:
annotations:
scheduler-simulator/bind-result: '{"DefaultBinder":"success"}'
scheduler-simulator/filter-result: >-
{"node-jjfg5":{"NodeName":"passed","NodeResourcesFit":"passed","NodeUnschedulable":"passed","TaintToleration":"passed"},"node-mtb5x":{"NodeName":"passed","NodeResourcesFit":"passed","NodeUnschedulable":"passed","TaintToleration":"passed"}}
scheduler-simulator/finalscore-result: >-
{"node-jjfg5":{"ImageLocality":"0","NodeAffinity":"0","NodeResourcesBalancedAllocation":"52","NodeResourcesFit":"47","TaintToleration":"300","VolumeBinding":"0"},"node-mtb5x":{"ImageLocality":"0","NodeAffinity":"0","NodeResourcesBalancedAllocation":"76","NodeResourcesFit":"73","TaintToleration":"300","VolumeBinding":"0"}}
scheduler-simulator/permit-result: '{}'
scheduler-simulator/permit-result-timeout: '{}'
scheduler-simulator/postfilter-result: '{}'
scheduler-simulator/prebind-result: '{"VolumeBinding":"success"}'
scheduler-simulator/prefilter-result: '{}'
scheduler-simulator/prefilter-result-status: >-
{"AzureDiskLimits":"","EBSLimits":"","GCEPDLimits":"","InterPodAffinity":"","NodeAffinity":"","NodePorts":"","NodeResourcesFit":"success","NodeVolumeLimits":"","PodTopologySpread":"","VolumeBinding":"","VolumeRestrictions":"","VolumeZone":""}
scheduler-simulator/prescore-result: >-
{"InterPodAffinity":"","NodeAffinity":"success","NodeResourcesBalancedAllocation":"success","NodeResourcesFit":"success","PodTopologySpread":"","TaintToleration":"success"}
scheduler-simulator/reserve-result: '{"VolumeBinding":"success"}'
scheduler-simulator/result-history: >-
[{"scheduler-simulator/bind-result":"{\"DefaultBinder\":\"success\"}","scheduler-simulator/filter-result":"{\"node-jjfg5\":{\"NodeName\":\"passed\",\"NodeResourcesFit\":\"passed\",\"NodeUnschedulable\":\"passed\",\"TaintToleration\":\"passed\"},\"node-mtb5x\":{\"NodeName\":\"passed\",\"NodeResourcesFit\":\"passed\",\"NodeUnschedulable\":\"passed\",\"TaintToleration\":\"passed\"}}","scheduler-simulator/finalscore-result":"{\"node-jjfg5\":{\"ImageLocality\":\"0\",\"NodeAffinity\":\"0\",\"NodeResourcesBalancedAllocation\":\"52\",\"NodeResourcesFit\":\"47\",\"TaintToleration\":\"300\",\"VolumeBinding\":\"0\"},\"node-mtb5x\":{\"ImageLocality\":\"0\",\"NodeAffinity\":\"0\",\"NodeResourcesBalancedAllocation\":\"76\",\"NodeResourcesFit\":\"73\",\"TaintToleration\":\"300\",\"VolumeBinding\":\"0\"}}","scheduler-simulator/permit-result":"{}","scheduler-simulator/permit-result-timeout":"{}","scheduler-simulator/postfilter-result":"{}","scheduler-simulator/prebind-result":"{\"VolumeBinding\":\"success\"}","scheduler-simulator/prefilter-result":"{}","scheduler-simulator/prefilter-result-status":"{\"AzureDiskLimits\":\"\",\"EBSLimits\":\"\",\"GCEPDLimits\":\"\",\"InterPodAffinity\":\"\",\"NodeAffinity\":\"\",\"NodePorts\":\"\",\"NodeResourcesFit\":\"success\",\"NodeVolumeLimits\":\"\",\"PodTopologySpread\":\"\",\"VolumeBinding\":\"\",\"VolumeRestrictions\":\"\",\"VolumeZone\":\"\"}","scheduler-simulator/prescore-result":"{\"InterPodAffinity\":\"\",\"NodeAffinity\":\"success\",\"NodeResourcesBalancedAllocation\":\"success\",\"NodeResourcesFit\":\"success\",\"PodTopologySpread\":\"\",\"TaintToleration\":\"success\"}","scheduler-simulator/reserve-result":"{\"VolumeBinding\":\"success\"}","scheduler-simulator/score-result":"{\"node-jjfg5\":{\"ImageLocality\":\"0\",\"NodeAffinity\":\"0\",\"NodeResourcesBalancedAllocation\":\"52\",\"NodeResourcesFit\":\"47\",\"TaintToleration\":\"0\",\"VolumeBinding\":\"0\"},\"node-mtb5x\":{\"ImageLocality\":\"0\",\"NodeAffinity\":\"0\",\"NodeResourcesBalancedAllocation\":\"76\",\"NodeResourcesFit\":\"73\",\"TaintToleration\":\"0\",\"VolumeBinding\":\"0\"}}","scheduler-simulator/selected-node":"node-mtb5x"}]
scheduler-simulator/score-result: >-
{"node-jjfg5":{"ImageLocality":"0","NodeAffinity":"0","NodeResourcesBalancedAllocation":"52","NodeResourcesFit":"47","TaintToleration":"0","VolumeBinding":"0"},"node-mtb5x":{"ImageLocality":"0","NodeAffinity":"0","NodeResourcesBalancedAllocation":"76","NodeResourcesFit":"73","TaintToleration":"0","VolumeBinding":"0"}}
scheduler-simulator/selected-node: node-mtb5x
Copy link
Contributor

Choose a reason for hiding this comment

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

If using this manifest unchanged, please call out that using the (unregistered) top level domain scheduler-simulator is not a recommended practice for Kubernetes object annotations. It's code from part of the Kubernetes project but it's not following Kubernetes good practice.

If possible, change the actual code to use a more appropriate domain name (eg scheduler-simulator.sigs.k8s.io - which would need registering) before publication. If not feasible to do that, please explain that the domain name in the key is a known bug.

I don't want to tacitly endorse poor practice with an official-looking article.


BTW, you can register annotations with a PR against k/website. We aim for this to be easy; all you need say is that the annotation is used by https://sigs.k8s.io/kube-scheduler-simulator

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, created kubernetes-sigs/kube-scheduler-simulator#386.
We're about to ship a new release, and we can include the fix for it. The fix should be very easy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Annotations now registered BTW

As mentioned earlier, with a limited set of tests, it is impossible to predict every possible scenario in a real-world cluster.
Typically, you will test the scheduler in a small, development cluster before deploying it to production, hoping that no issues arise.

[The simulator’s importing feature](https://github.com/kubernetes-sigs/kube-scheduler-simulator/blob/master/simulator/docs/import-cluster-resources.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[The simulator’s importing feature](https://github.com/kubernetes-sigs/kube-scheduler-simulator/blob/master/simulator/docs/import-cluster-resources.md)
The simulator's [importing](https://github.com/kubernetes-sigs/kube-scheduler-simulator/blob/simulator/v0.3.0/simulator/docs/import-cluster-resources.md)
feature


## What are the use cases?

1. **Cluster users**: Examine if your scheduling constraints (e.g., PodAffinity, PodTopologySpread) work as intended.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. **Cluster users**: Examine if your scheduling constraints (e.g., PodAffinity, PodTopologySpread) work as intended.
1. **Cluster users**: Examine if your scheduling constraints (e.g., Pod affinity, Pop topology spread) work as intended.

Comment on lines +105 to +106
2. **Cluster admins**: Assess how your cluster would behave with changes to the scheduler configuration.
3. **Scheduler plugin developers**: Test your custom scheduler plugins or extenders, use the debuggable scheduler in integration tests or development clusters, and use [the syncing feature](https://github.com/kubernetes-sigs/kube-scheduler-simulator/blob/master/simulator/docs/import-cluster-resources.md) for testing within a production-like environment.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. **Cluster admins**: Assess how your cluster would behave with changes to the scheduler configuration.
3. **Scheduler plugin developers**: Test your custom scheduler plugins or extenders, use the debuggable scheduler in integration tests or development clusters, and use [the syncing feature](https://github.com/kubernetes-sigs/kube-scheduler-simulator/blob/master/simulator/docs/import-cluster-resources.md) for testing within a production-like environment.
1. **Cluster admins**: Assess how your cluster would behave with changes to the scheduler configuration.
1. **Scheduler plugin developers**: Test your custom scheduler plugins or extenders, use the debuggable scheduler in integration tests or development clusters, or use the [syncing](https://github.com/kubernetes-sigs/kube-scheduler-simulator/blob/simulator/v0.3.0/simulator/docs/import-cluster-resources.md) feature for testing within a production-like environment.
  • The site renderer does the numbering for you
  • We avoid linking to trunk-like branches (main, master etc) as the link is unlikely to be long term stable.


## Getting involved

The Kube-scheduler-simulator is developed by Kubernetes SIG Scheduling. Your feedback and contributions are welcome!
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit)

Suggested change
The Kube-scheduler-simulator is developed by Kubernetes SIG Scheduling. Your feedback and contributions are welcome!
The scheduler simulator is developed by Kubernetes SIG Scheduling. Your feedback and contributions are welcome!


The Kube-scheduler-simulator is developed by Kubernetes SIG Scheduling. Your feedback and contributions are welcome!

Open issues or PRs at [Kube-scheduler-simulator repository](sigs.k8s.io/kube-scheduler-simulator)
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit)

Suggested change
Open issues or PRs at [Kube-scheduler-simulator repository](sigs.k8s.io/kube-scheduler-simulator)
Open issues or PRs at the [kube-scheduler-simulator repository](https://sigs.k8s.io/kube-scheduler-simulator).


A big shout out to all [the awesome contributors](https://github.com/kubernetes-sigs/kube-scheduler-simulator/graphs/contributors)!

![contributors](./contributors.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

This actually doesn't need a figure shortcode, but should have a more descriptive alt attribute.

make docker_up
```

You can then access the simulator's web UI at http://localhost:3000.
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit)

Suggested change
You can then access the simulator's web UI at http://localhost:3000.
You can then access the simulator's web UI at `http://localhost:3000`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/blog Issues or PRs related to the Kubernetes Blog subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

9 participants