Daily Exercise 003: How-Kubernetes-Scheduler-Works
Day 1 Script
Today we are going to talk about how the scheduler in Kubernetes works. First of all, it is worth noting what the scheduler actually is. In Kubernetes, you have a bunch of machines and a single container that a user has asked to run. The job of the scheduler is to figure out which specific machine should execute this container. It decides where to place the workload across all the available nodes. This is one of the most important jobs in the cluster because without it, the containers would have no idea where they should be running. It is very similar to how an operating system on your laptop determines when and where a particular program should execute.
Day 1 Translate
| Japanese | English |
|---|---|
| 今日は話し合います、Kubernetesのスケジューラがどのように機能するかを | Today we are going to talk about how the scheduler in Kubernetes works. |
| Kubernetesには、多数のマシンと、ユーザーが実行を依頼した単一のコンテナがあります | In Kubernetes, you have a bunch of machines and a single container that a user has asked to run. |
| スケジューラの仕事は判断することです、どの特定のマシンがこのコンテナを実行すべきかを | The job of the scheduler is to figure out which specific machine should execute this container. |
| それは判断します、利用可能なすべてのノードの中でどこにワークロードを配置するかを | It decides where to place the workload across all the available nodes. |
| これは最も重要な仕事の1つです、これがないと、コンテナは自分がどこで実行されるべきかわからないからです | This is one of the most important jobs in the cluster because without it, the containers would have no idea where they should be running. |
| それはよく似ています、お使いのラップトップのOSが特定のプログラムがいつどこで実行されるべきかを決定する方法と | It is very similar to how an operating system on your laptop determines when and where a particular program should execute. |
Day 2 Script
When you create a pod, that object exists in the Kubernetes API, but it does not have a node associated with it yet. The API object for that pod does not have a machine that has been scheduled onto. The scheduler is continually watching for pods that have been created but have not been successfully scheduled. It is also continually watching the state of all of the machines. Of course, where to schedule the container has a lot to do with the current existing state of a particular machine. What the scheduler is thinking about when it makes a decision is a mixture of two things. These are predicates and priorities.
Day 2 Translate
| Japanese | English |
|---|---|
| ポッドを作成すると、そのオブジェクトはKubernetes APIに存在しますが、まだノードが関連付けられていません | When you create a pod, that object exists in the Kubernetes API, but it does not have a node associated with it yet. |
| そのポッドのAPIオブジェクトには、スケジュールされた先の、マシンが割り当てられていません | The API object for that pod does not have a machine that has been scheduled onto. |
| スケジューラは継続的に監視しています、作成されたけれどもうまくスケジュールされていないポッドを | The scheduler is continually watching for pods that have been created but have not been successfully scheduled. |
| それはまた継続的に監視しています、すべてのマシンの状態を | It is also continually watching the state of all of the machines. |
| スケジューラが判断を下すときに考えていることは、2つの事柄の混合です | What the scheduler is thinking about when it makes a decision is a mixture of two things. |
| これらは、プレディケートとプライオリティです | These are predicates and priorities. |
Day 3 Script
Predicates are hard constraints that cannot be violated. They include things like memory requirements or node selectors. For example, you might need to run on a machine with at least four gigabytes of memory. If a machine does not have enough memory, there is no way that the container can be scheduled there. Predicates eliminate machines entirely from consideration. Hard constraints are a mix of things that are system supplied and things that a user can supply. You could say you only want to schedule onto machines that have a label of SSD, which means they have flash hard drives available to them.
Day 3 Translate
| Japanese | English |
|---|---|
| プレディケートは、違反することができないハードな制約です | Predicates are hard constraints that cannot be violated. |
| それらは含みます、メモリ要件やノードセレクタのようなものを | They include things like memory requirements or node selectors. |
| マシンに十分なメモリがない場合、そのコンテナをそこにスケジュールする方法はありません | If a machine does not have enough memory, there is no way that the container can be scheduled there. |
| プレディケートは、スケジューラの検討対象から、マシンを完全に除外します | Predicates eliminate machines entirely from consideration. |
| ハードな制約は、システムが提供するものとユーザーが提供できるものの混合です | Hard constraints are a mix of things that are system supplied and things that a user can supply. |
| あなたは指定できます、SSDのラベルを持つマシンにのみスケジュールしたいと | You could say you only want to schedule onto machines that have a label of SSD, which means they have flash hard drives available to them. |
Day 4 Script
Priorities are soft constraints. They are things that would be nice if your application was spread across multiple machines. Spreading is the desire for an application to be spread across multiple machines, so if one happens to fail, the entire application does not fail. Priorities can be violated but give you some sense of the badness or goodness of either satisfying or not satisfying the constraint. For example, if you have absolutely no space to run three replicas of your application without putting two of them on the same machine, you would still rather place them on one machine than not run them at all.
Day 4 Translate
| Japanese | English |
|---|---|
| プライオリティはソフトな制約です | Priorities are soft constraints. |
| それらは、アプリケーションが複数のマシンに分散されるのが望ましいといった事柄です | They are things that would be nice if your application was spread across multiple machines. |
| スプレッディングは、アプリケーションを複数のマシンに分散させたいという要望です、そうすれば、一方が失敗しても、アプリケーション全体が失敗することはありません | Spreading is the desire for an application to be spread across multiple machines, so if one happens to fail, the entire application does not fail. |
| プライオリティは違反することができますが、制約を満たすか満たさないかの良し悪しを判断する基準を与えます | Priorities can be violated but give you some sense of the badness or goodness of either satisfying or not satisfying the constraint. |
| 同じマシンに2つ配置する方が、まったく実行しないよりもましだと、考えるでしょう | You would still rather place them on one machine than not run them at all. |
Day 5 Script
The actual scoring associated with priorities can give you some notion of how the scheduler behaves. Ultimately, it is this mixture of predicates that eliminate whole machines from consideration and priorities that give you the relative value of the different machines. The way this works is that the first step starts with a complete list of nodes. The scheduler filters those nodes by the predicates and then sorts those filtered nodes by the priorities. The number one node that comes out of this sort is going to be the place where the container is actually going to be scheduled in the cluster.
Day 5 Translate
| Japanese | English |
|---|---|
| プライオリティに関連付けられた実際のスコアリングは、スケジューラの挙動の概念を与えます | The actual scoring associated with priorities can give you some notion of how the scheduler behaves. |
| 結局のところ、それは、全マシンを除外するプレディケートと、相対的な価値を与えるプライオリティの混合です | Ultimately, it is this mixture of predicates that eliminate whole machines from consideration and priorities that give you the relative value of the different machines. |
| この仕組みは、まず、ノードの完全なリストから始まります | The way this works is that the first step starts with a complete list of nodes. |
| スケジューラは、それらのノードをプレディケートでフィルタリングし、次に、プライオリティでソートします | The scheduler filters those nodes by the predicates and then sorts those filtered nodes by the priorities. |
| このソートから出てくる一番のノードが、コンテナが実際にスケジュールされる場所になります、クラスターの中で | The number one node that comes out of this sort is going to be the place where the container is actually going to be scheduled in the cluster. |