From 9d5f11a3c28d3268a7bf13913aaf3474d197b29c Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sat, 25 Jul 2020 13:54:40 +0900 Subject: [PATCH 1/3] Copy tasks/manage-hugepages/scheduling-hugepages.md from en/ directory. --- .../manage-hugepages/scheduling-hugepages.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md diff --git a/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md b/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md new file mode 100644 index 0000000000..a349f123aa --- /dev/null +++ b/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md @@ -0,0 +1,120 @@ +--- +reviewers: +- derekwaynecarr +title: Manage HugePages +content_type: task +description: Configure and manage huge pages as a schedulable resource in a cluster. +--- + + +{{< feature-state state="stable" >}} + +Kubernetes supports the allocation and consumption of pre-allocated huge pages +by applications in a Pod. This page describes how users can consume huge pages. + +## {{% heading "prerequisites" %}} + + +1. Kubernetes nodes must pre-allocate huge pages in order for the node to report + its huge page capacity. A node can pre-allocate huge pages for multiple + sizes. + +The nodes will automatically discover and report all huge page resources as +schedulable resources. + + + + + +## API + +Huge pages can be consumed via container level resource requirements using the +resource name `hugepages-`, where `` is the most compact binary +notation using integer values supported on a particular node. For example, if a +node supports 2048KiB and 1048576KiB page sizes, it will expose a schedulable +resources `hugepages-2Mi` and `hugepages-1Gi`. Unlike CPU or memory, huge pages +do not support overcommit. Note that when requesting hugepage resources, either +memory or CPU resources must be requested as well. + +A pod may consume multiple huge page sizes in a single pod spec. In this case it +must use `medium: HugePages-` notation for all volume mounts. + + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: huge-pages-example +spec: + containers: + - name: example + image: fedora:latest + command: + - sleep + - inf + volumeMounts: + - mountPath: /hugepages-2Mi + name: hugepage-2mi + - mountPath: /hugepages-1Gi + name: hugepage-1gi + resources: + limits: + hugepages-2Mi: 100Mi + hugepages-1Gi: 2Gi + memory: 100Mi + requests: + memory: 100Mi + volumes: + - name: hugepage-2mi + emptyDir: + medium: HugePages-2Mi + - name: hugepage-1gi + emptyDir: + medium: HugePages-1Gi +``` + +A pod may use `medium: HugePages` only if it requests huge pages of one size. + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: huge-pages-example +spec: + containers: + - name: example + image: fedora:latest + command: + - sleep + - inf + volumeMounts: + - mountPath: /hugepages + name: hugepage + resources: + limits: + hugepages-2Mi: 100Mi + memory: 100Mi + requests: + memory: 100Mi + volumes: + - name: hugepage + emptyDir: + medium: HugePages +``` + +- Huge page requests must equal the limits. This is the default if limits are + specified, but requests are not. +- Huge pages are isolated at a container scope, so each container has own limit on their cgroup sandbox as requested in a container spec. +- EmptyDir volumes backed by huge pages may not consume more huge page memory + than the pod request. +- Applications that consume huge pages via `shmget()` with `SHM_HUGETLB` must + run with a supplemental group that matches `proc/sys/vm/hugetlb_shm_group`. +- Huge page usage in a namespace is controllable via ResourceQuota similar +to other compute resources like `cpu` or `memory` using the `hugepages-` +token. +- Support of multiple sizes huge pages is feature gated. It can be + enabled with the `HugePageStorageMediumSize` [feature +gate](/docs/reference/command-line-tools-reference/feature-gates/) on the {{< +glossary_tooltip text="kubelet" term_id="kubelet" >}} and {{< +glossary_tooltip text="kube-apiserver" +term_id="kube-apiserver" >}} (`--feature-gates=HugePageStorageMediumSize=true`). From 511724ca0f1585c8f9b72ae7c3cd5f411379512c Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sat, 25 Jul 2020 13:55:01 +0900 Subject: [PATCH 2/3] Translate tasks/manage-hugepages/scheduling-hugepages into Japanese. --- .../manage-hugepages/scheduling-hugepages.md | 55 +++++-------------- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md b/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md index a349f123aa..2cf69b8eaf 100644 --- a/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md +++ b/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md @@ -1,44 +1,27 @@ --- -reviewers: -- derekwaynecarr -title: Manage HugePages +title: HugePageを管理する content_type: task -description: Configure and manage huge pages as a schedulable resource in a cluster. +description: クラスター内のスケジュール可能なリソースとしてhuge pageの設定と管理を行います。 --- {{< feature-state state="stable" >}} -Kubernetes supports the allocation and consumption of pre-allocated huge pages -by applications in a Pod. This page describes how users can consume huge pages. +Kubernetesでは、事前割り当てされたhuge pageをPod内のアプリケーションに割り当てたり利用したりすることをサポートしています。このページでは、ユーザーがhuge pageを利用できるようにする方法について説明します。 ## {{% heading "prerequisites" %}} +1. Kubernetesのノードがhuge pageのキャパシティを報告するためには、ノード上でhuge pageを事前割り当てしておく必要があります。1つのノードでは複数のサイズのhuge pageが事前割り当てできます。 -1. Kubernetes nodes must pre-allocate huge pages in order for the node to report - its huge page capacity. A node can pre-allocate huge pages for multiple - sizes. - -The nodes will automatically discover and report all huge page resources as -schedulable resources. - - +ノードは、すべてのhuge pageリソースを、スケジュール可能なリソースとして自動的に探索・報告してくれます。 ## API -Huge pages can be consumed via container level resource requirements using the -resource name `hugepages-`, where `` is the most compact binary -notation using integer values supported on a particular node. For example, if a -node supports 2048KiB and 1048576KiB page sizes, it will expose a schedulable -resources `hugepages-2Mi` and `hugepages-1Gi`. Unlike CPU or memory, huge pages -do not support overcommit. Note that when requesting hugepage resources, either -memory or CPU resources must be requested as well. - -A pod may consume multiple huge page sizes in a single pod spec. In this case it -must use `medium: HugePages-` notation for all volume mounts. +huge pageはコンテナレベルのリソース要求で`hugepages-`という名前のリソースを指定することで利用できます。ここで、``は、特定のノード上でサポートされている整数値を使った最も小さなバイナリ表記です。たとえば、ノードが2048KiBと1048576KiBのページサイズをサポートしている場合、ノードはスケジュール可能なリソースとして、`hugepages-2Mi`と`hugepages-1Gi`の2つのリソースを公開します。CPUやメモリとは違い、huge pageはオーバーコミットをサポートしません。hugepageリソースをリクエストするときには、メモリやCPUリソースを同時にリクエストしなければならないことに注意してください。 +1つのPodのspec内に書くことで、Podから複数のサイズのhuge pageを利用することもできます。その場合、すべてのボリュームマウントで`medium: HugePages-`という表記を使う必要があります。 ```yaml apiVersion: v1 @@ -73,7 +56,7 @@ spec: medium: HugePages-1Gi ``` -A pod may use `medium: HugePages` only if it requests huge pages of one size. +Podで1種類のサイズのhuge pageをリクエストするときだけは、`medium: HugePages`という表記を使うこともできます。 ```yaml apiVersion: v1 @@ -102,19 +85,9 @@ spec: medium: HugePages ``` -- Huge page requests must equal the limits. This is the default if limits are - specified, but requests are not. -- Huge pages are isolated at a container scope, so each container has own limit on their cgroup sandbox as requested in a container spec. -- EmptyDir volumes backed by huge pages may not consume more huge page memory - than the pod request. -- Applications that consume huge pages via `shmget()` with `SHM_HUGETLB` must - run with a supplemental group that matches `proc/sys/vm/hugetlb_shm_group`. -- Huge page usage in a namespace is controllable via ResourceQuota similar -to other compute resources like `cpu` or `memory` using the `hugepages-` -token. -- Support of multiple sizes huge pages is feature gated. It can be - enabled with the `HugePageStorageMediumSize` [feature -gate](/docs/reference/command-line-tools-reference/feature-gates/) on the {{< -glossary_tooltip text="kubelet" term_id="kubelet" >}} and {{< -glossary_tooltip text="kube-apiserver" -term_id="kube-apiserver" >}} (`--feature-gates=HugePageStorageMediumSize=true`). +- huge pageのrequestsはlimitsと等しくなければなりません。limitsを指定した場合にはこれがデフォルトですが、requestsを指定しなかった場合にはデフォルトではありません。 +- huge pageはコンテナのスコープで隔離されるため、各コンテナにはそれぞれのcgroupサンドボックスの中でcontainer specでリクエストされた通りのlimitが設定されます。 +- huge pageベースのEmptyDirボリュームは、Podがリクエストしたよりも大きなサイズのページメモリーを使用できません。 +- `shmget()`に`SHM_HUGETLB`を指定して取得したhuge pageを使用するアプリケーションは、`/proc/sys/vm/hugetlb_shm_group`に一致する補助グループ(supplemental group)を使用して実行する必要があります。 +- namespace内のhuge pageの使用量は、ResourceQuotaに対して`cpu`や`memory`のような他の計算リソースと同じように`hugepages-`というトークンを使用することで制御できます。 +- 複数のサイズのhuge pageのサポートはフィーチャーゲートによる設定が必要です。{{< glossary_tooltip text="kubelet" term_id="kubelet" >}}と{{< glossary_tooltip text="kube-apiserver" term_id="kube-apiserver" >}}上で、`HugePageStorageMediumSize`[フィーチャーゲート](/ja/docs/reference/command-line-tools-reference/feature-gates/)を使用すると有効にできます(`--feature-gates=HugePageStorageMediumSize=true`)。 From 3594dce7ef08c76206e8dd9a9bb35f59e807696c Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sat, 25 Jul 2020 17:27:55 +0900 Subject: [PATCH 3/3] Use consistent word "huge page". --- .../ja/docs/tasks/manage-hugepages/scheduling-hugepages.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md b/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md index 2cf69b8eaf..ed87cf4e3f 100644 --- a/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md +++ b/content/ja/docs/tasks/manage-hugepages/scheduling-hugepages.md @@ -1,5 +1,5 @@ --- -title: HugePageを管理する +title: huge pageを管理する content_type: task description: クラスター内のスケジュール可能なリソースとしてhuge pageの設定と管理を行います。 --- @@ -19,7 +19,7 @@ Kubernetesでは、事前割り当てされたhuge pageをPod内のアプリケ ## API -huge pageはコンテナレベルのリソース要求で`hugepages-`という名前のリソースを指定することで利用できます。ここで、``は、特定のノード上でサポートされている整数値を使った最も小さなバイナリ表記です。たとえば、ノードが2048KiBと1048576KiBのページサイズをサポートしている場合、ノードはスケジュール可能なリソースとして、`hugepages-2Mi`と`hugepages-1Gi`の2つのリソースを公開します。CPUやメモリとは違い、huge pageはオーバーコミットをサポートしません。hugepageリソースをリクエストするときには、メモリやCPUリソースを同時にリクエストしなければならないことに注意してください。 +huge pageはコンテナレベルのリソース要求で`hugepages-`という名前のリソースを指定することで利用できます。ここで、``は、特定のノード上でサポートされている整数値を使った最も小さなバイナリ表記です。たとえば、ノードが2048KiBと1048576KiBのページサイズをサポートしている場合、ノードはスケジュール可能なリソースとして、`hugepages-2Mi`と`hugepages-1Gi`の2つのリソースを公開します。CPUやメモリとは違い、huge pageはオーバーコミットをサポートしません。huge pageリソースをリクエストするときには、メモリやCPUリソースを同時にリクエストしなければならないことに注意してください。 1つのPodのspec内に書くことで、Podから複数のサイズのhuge pageを利用することもできます。その場合、すべてのボリュームマウントで`medium: HugePages-`という表記を使う必要があります。