|
| 1 | +--- |
| 2 | +layout: blog |
| 3 | +title: "Introducing KWOK: Kubernetes WithOut Kubelet" |
| 4 | +date: 2023-03-01 |
| 5 | +slug: introducing-kwok |
| 6 | +canonicalUrl: https://kubernetes.dev/blog/2023/03/01/introducing-kwok/ |
| 7 | +--- |
| 8 | + |
| 9 | +**Author:** Shiming Zhang (DaoCloud), Wei Huang (Apple), Yibo Zhuang (Apple) |
| 10 | + |
| 11 | +<img style="float: right; display: inline-block; margin-left: 2em; max-width: 15em;" src="/blog/2023/03/01/introducing-kwok/kwok.svg" alt="KWOK logo" /> |
| 12 | + |
| 13 | +Have you ever wondered how to set up a cluster of thousands of nodes just in seconds, how to simulate real nodes with a low resource footprint, and how to test your Kubernetes controller at scale without spending much on infrastructure? |
| 14 | + |
| 15 | +If you answered "yes" to any of these questions, then you might be interested in KWOK, a toolkit that enables you to create a cluster of thousands of nodes in seconds. |
| 16 | + |
| 17 | +## What is KWOK? |
| 18 | + |
| 19 | +KWOK stands for Kubernetes WithOut Kubelet. So far, it provides two tools: |
| 20 | + |
| 21 | +`kwok` |
| 22 | +: `kwok` is the cornerstone of this project, responsible for simulating the lifecycle of fake nodes, pods, and other Kubernetes API resources. |
| 23 | + |
| 24 | +`kwokctl` |
| 25 | +: `kwokctl` is a CLI tool designed to streamline the creation and management of clusters, with nodes simulated by `kwok`. |
| 26 | + |
| 27 | +## Why use KWOK? |
| 28 | + |
| 29 | +KWOK has several advantages: |
| 30 | + |
| 31 | +- **Speed**: You can create and delete clusters and nodes almost instantly, without waiting for boot or provisioning. |
| 32 | +- **Compatibility**: KWOK works with any tools or clients that are compliant with Kubernetes APIs, such as kubectl, helm, kui, etc. |
| 33 | +- **Portability**: KWOK has no specific hardware or software requirements. You can run it using pre-built images, once Docker or Nerdctl is installed. Alternatively, binaries are also available for all platforms and can be easily installed. |
| 34 | +- **Flexibility**: You can configure different node types, labels, taints, capacities, conditions, etc., and you can configure different pod behaviors, status, etc. to test different scenarios and edge cases. |
| 35 | +- **Performance**: You can simulate thousands of nodes on your laptop without significant consumption of CPU or memory resources. |
| 36 | + |
| 37 | +## What are the use cases? |
| 38 | + |
| 39 | +KWOK can be used for various purposes: |
| 40 | + |
| 41 | +- **Learning**: You can use KWOK to learn about Kubernetes concepts and features without worrying about resource waste or other consequences. |
| 42 | +- **Development**: You can use KWOK to develop new features or tools for Kubernetes without accessing to a real cluster or requiring other components. |
| 43 | +- **Testing**: |
| 44 | + - You can measure how well your application or controller scales with different numbers of nodes and(or) pods. |
| 45 | + - You can generate high loads on your cluster by creating many pods or services with different resource requests or limits. |
| 46 | + - You can simulate node failures or network partitions by changing node conditions or randomly deleting nodes. |
| 47 | + - You can test how your controller interacts with other components or features of Kubernetes by enabling different feature gates or API versions. |
| 48 | + |
| 49 | +## What are the limitations? |
| 50 | + |
| 51 | +KWOK is not intended to replace others completely. It has some limitations that you should be aware of: |
| 52 | + |
| 53 | +- **Functionality**: KWOK is not a kubelet and may exhibit different behaviors in areas such as pod lifecycle management, volume mounting, and device plugins. Its primary function is to simulate updates of node and pod status. |
| 54 | +- **Accuracy**: It's important to note that KWOK doesn't accurately reflect the performance or behavior of real nodes under various workloads or environments. Instead, it approximates some behaviors using simple formulas. |
| 55 | +- **Security**: KWOK does not enforce any security policies or mechanisms on simulated nodes. It assumes that all requests from the kube-apiserver are authorized and valid. |
| 56 | + |
| 57 | +## Getting started |
| 58 | + |
| 59 | +If you are interested in trying out KWOK, please check its [documents] for more details. |
| 60 | + |
| 61 | +{{< figure src="/blog/2023/03/01/introducing-kwok/manage-clusters.svg" alt="Animation of a terminal showing kwokctl in use" caption="Using kwokctl to manage simulated clusters" >}} |
| 62 | + |
| 63 | +## Getting Involved |
| 64 | + |
| 65 | +If you're interested in participating in future discussions or development related to KWOK, there are several ways to get involved: |
| 66 | + |
| 67 | +- Slack: [#kwok] for general usage discussion, [#kwok-dev] for development discussion. (visit [slack.k8s.io] for a workspace invitation) |
| 68 | +- Open Issues/PRs/Discussions in [sigs.k8s.io/kwok] |
| 69 | + |
| 70 | +We welcome feedback and contributions from anyone who wants to join us in this exciting project. |
| 71 | + |
| 72 | +[documents]: https://kwok.sigs.k8s.io/ |
| 73 | +[sigs.k8s.io/kwok]: https://sigs.k8s.io/kwok/ |
| 74 | +[#kwok]: https://kubernetes.slack.com/messages/kwok/ |
| 75 | +[#kwok-dev]: https://kubernetes.slack.com/messages/kwok-dev/ |
| 76 | +[slack.k8s.io]: https://slack.k8s.io/ |
0 commit comments