From f28cae995fa2b98d6e1a42335ede32cfc2e3f045 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Tue, 18 Aug 2020 10:10:52 +0900 Subject: [PATCH 1/4] Copy tasks/configure-pod-container/static-pod.md and glossary word files from en/ directory. --- content/ja/docs/reference/glossary/docker.md | 17 ++ .../ja/docs/reference/glossary/mirror-pod.md | 21 ++ .../configure-pod-container/static-pod.md | 240 ++++++++++++++++++ 3 files changed, 278 insertions(+) create mode 100755 content/ja/docs/reference/glossary/docker.md create mode 100755 content/ja/docs/reference/glossary/mirror-pod.md create mode 100644 content/ja/docs/tasks/configure-pod-container/static-pod.md diff --git a/content/ja/docs/reference/glossary/docker.md b/content/ja/docs/reference/glossary/docker.md new file mode 100755 index 0000000000..fee6a7d838 --- /dev/null +++ b/content/ja/docs/reference/glossary/docker.md @@ -0,0 +1,17 @@ +--- +title: Docker +id: docker +date: 2018-04-12 +full_link: https://docs.docker.com/engine/ +short_description: > + Docker is a software technology providing operating-system-level virtualization also known as containers. + +aka: +tags: +- fundamental +--- +Docker (specifically, Docker Engine) is a software technology providing operating-system-level virtualization also known as {{< glossary_tooltip text="containers" term_id="container" >}}. + + + +Docker uses the resource isolation features of the Linux kernel such as cgroups and kernel namespaces, and a union-capable file system such as OverlayFS and others to allow independent containers to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines (VMs). diff --git a/content/ja/docs/reference/glossary/mirror-pod.md b/content/ja/docs/reference/glossary/mirror-pod.md new file mode 100755 index 0000000000..c925e4d672 --- /dev/null +++ b/content/ja/docs/reference/glossary/mirror-pod.md @@ -0,0 +1,21 @@ +--- +title: Mirror Pod +id: mirror-pod +date: 2019-08-06 +short_description: > + An object in the API server that tracks a static pod on a kubelet. + +aka: +tags: +- fundamental +--- + A {{< glossary_tooltip text="pod" term_id="pod" >}} object that a kubelet uses + to represent a {{< glossary_tooltip text="static pod" term_id="static-pod" >}} + + + +When the kubelet finds a static pod in its configuration, it automatically tries to +create a Pod object on the Kubernetes API server for it. This means that the pod +will be visible on the API server, but cannot be controlled from there. + +(For example, removing a mirror pod will not stop the kubelet daemon from running it). diff --git a/content/ja/docs/tasks/configure-pod-container/static-pod.md b/content/ja/docs/tasks/configure-pod-container/static-pod.md new file mode 100644 index 0000000000..cf31d822d6 --- /dev/null +++ b/content/ja/docs/tasks/configure-pod-container/static-pod.md @@ -0,0 +1,240 @@ +--- +reviewers: +- jsafrane +title: Create static Pods +weight: 170 +content_type: task +--- + + + + +*Static Pods* are managed directly by the kubelet daemon on a specific node, +without the {{< glossary_tooltip text="API server" term_id="kube-apiserver" >}} +observing them. +Unlike Pods that are managed by the control plane (for example, a +{{< glossary_tooltip text="Deployment" term_id="deployment" >}}); +instead, the kubelet watches each static Pod (and restarts it if it fails). + +Static Pods are always bound to one {{< glossary_tooltip term_id="kubelet" >}} on a specific node. + +The kubelet automatically tries to create a {{< glossary_tooltip text="mirror Pod" term_id="mirror-pod" >}} +on the Kubernetes API server for each static Pod. +This means that the Pods running on a node are visible on the API server, +but cannot be controlled from there. + +{{< note >}} +If you are running clustered Kubernetes and are using static +Pods to run a Pod on every node, you should probably be using a +{{< glossary_tooltip text="DaemonSet" term_id="daemonset" >}} +instead. +{{< /note >}} + + + +## {{% heading "prerequisites" %}} + + +{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} + +This page assumes you're using {{< glossary_tooltip term_id="docker" >}} to run Pods, +and that your nodes are running the Fedora operating system. +Instructions for other distributions or Kubernetes installations may vary. + + + + + + + +## Create a static pod {#static-pod-creation} + +You can configure a static Pod with either a [file system hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#configuration-files) or a [web hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#pods-created-via-http). + +### Filesystem-hosted static Pod manifest {#configuration-files} + +Manifests are standard Pod definitions in JSON or YAML format in a specific directory. Use the `staticPodPath: ` field in the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file), which periodically scans the directory and creates/deletes static Pods as YAML/JSON files appear/disappear there. +Note that the kubelet will ignore files starting with dots when scanning the specified directory. + +For example, this is how to start a simple web server as a static Pod: + +1. Choose a node where you want to run the static Pod. In this example, it's `my-node1`. + + ```shell + ssh my-node1 + ``` + +2. Choose a directory, say `/etc/kubelet.d` and place a web server Pod definition there, for example `/etc/kubelet.d/static-web.yaml`: + + ```shell + # Run this command on the node where kubelet is running + mkdir /etc/kubelet.d/ + cat </etc/kubelet.d/static-web.yaml + apiVersion: v1 + kind: Pod + metadata: + name: static-web + labels: + role: myrole + spec: + containers: + - name: web + image: nginx + ports: + - name: web + containerPort: 80 + protocol: TCP + EOF + ``` + +3. Configure your kubelet on the node to use this directory by running it with `--pod-manifest-path=/etc/kubelet.d/` argument. On Fedora edit `/etc/kubernetes/kubelet` to include this line: + + ``` + KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --pod-manifest-path=/etc/kubelet.d/" + ``` + or add the `staticPodPath: ` field in the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file). + +4. Restart the kubelet. On Fedora, you would run: + + ```shell + # Run this command on the node where the kubelet is running + systemctl restart kubelet + ``` + +### Web-hosted static pod manifest {#pods-created-via-http} + +Kubelet periodically downloads a file specified by `--manifest-url=` argument +and interprets it as a JSON/YAML file that contains Pod definitions. +Similar to how [filesystem-hosted manifests](#configuration-files) work, the kubelet +refetches the manifest on a schedule. If there are changes to the list of static +Pods, the kubelet applies them. + +To use this approach: + +1. Create a YAML file and store it on a web server so that you can pass the URL of that file to the kubelet. + + ```yaml + apiVersion: v1 + kind: Pod + metadata: + name: static-web + labels: + role: myrole + spec: + containers: + - name: web + image: nginx + ports: + - name: web + containerPort: 80 + protocol: TCP + ``` + +2. Configure the kubelet on your selected node to use this web manifest by running it with `--manifest-url=`. On Fedora, edit `/etc/kubernetes/kubelet` to include this line: + + ``` + KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --manifest-url=" + ``` + +3. Restart the kubelet. On Fedora, you would run: + + ```shell + # Run this command on the node where the kubelet is running + systemctl restart kubelet + ``` + +## Observe static pod behavior {#behavior-of-static-pods} + +When the kubelet starts, it automatically starts all defined static Pods. As you have +defined a static Pod and restarted the kubelet, the new static Pod should +already be running. + +You can view running containers (including static Pods) by running (on the node): +```shell +# Run this command on the node where the kubelet is running +docker ps +``` + +The output might be something like: + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +f6d05272b57e nginx:latest "nginx" 8 minutes ago Up 8 minutes k8s_web.6f802af4_static-web-fk-node1_default_67e24ed9466ba55986d120c867395f3c_378e5f3c +``` + +You can see the mirror Pod on the API server: + +```shell +kubectl get pods +``` +``` +NAME READY STATUS RESTARTS AGE +static-web-my-node1 1/1 Running 0 2m +``` + +{{< note >}} +Make sure the kubelet has permission to create the mirror Pod in the API server. If not, the creation request is rejected by the API server. See +[PodSecurityPolicy](/docs/concepts/policy/pod-security-policy/). +{{< /note >}} + + +{{< glossary_tooltip term_id="label" text="Labels" >}} from the static Pod are +propagated into the mirror Pod. You can use those labels as normal via +{{< glossary_tooltip term_id="selector" text="selectors" >}}, etc. + +If you try to use `kubectl` to delete the mirror Pod from the API server, +the kubelet _doesn't_ remove the static Pod: + +```shell +kubectl delete pod static-web-my-node1 +``` +``` +pod "static-web-my-node1" deleted +``` +You can see that the Pod is still running: +```shell +kubectl get pods +``` +``` +NAME READY STATUS RESTARTS AGE +static-web-my-node1 1/1 Running 0 12s +``` + +Back on your node where the kubelet is running, you can try to stop the Docker +container manually. +You'll see that, after a time, the kubelet will notice and will restart the Pod +automatically: + +```shell +# Run these commands on the node where the kubelet is running +docker stop f6d05272b57e # replace with the ID of your container +sleep 20 +docker ps +``` +``` +CONTAINER ID IMAGE COMMAND CREATED ... +5b920cbaf8b1 nginx:latest "nginx -g 'daemon of 2 seconds ago ... +``` + +## Dynamic addition and removal of static pods + +The running kubelet periodically scans the configured directory (`/etc/kubelet.d` in our example) for changes and adds/removes Pods as files appear/disappear in this directory. + +```shell +# This assumes you are using filesystem-hosted static Pod configuration +# Run these commands on the node where the kubelet is running +# +mv /etc/kubelet.d/static-web.yaml /tmp +sleep 20 +docker ps +# You see that no nginx container is running +mv /tmp/static-web.yaml /etc/kubelet.d/ +sleep 20 +docker ps +``` +``` +CONTAINER ID IMAGE COMMAND CREATED ... +e7a62e3427f1 nginx:latest "nginx -g 'daemon of 27 seconds ago +``` + + From 2803a7bd9fac808f3bc206d0e62eddfeea2d5a4b Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Tue, 18 Aug 2020 10:01:42 +0900 Subject: [PATCH 2/4] Translate "docker", "mirror-pod", and "label" in the glossary and modify "selector". --- content/ja/docs/reference/glossary/docker.md | 6 +++--- content/ja/docs/reference/glossary/label.md | 17 +++++++++++++++++ .../ja/docs/reference/glossary/mirror-pod.md | 13 +++++-------- content/ja/docs/reference/glossary/selector.md | 4 ++-- 4 files changed, 27 insertions(+), 13 deletions(-) create mode 100755 content/ja/docs/reference/glossary/label.md diff --git a/content/ja/docs/reference/glossary/docker.md b/content/ja/docs/reference/glossary/docker.md index fee6a7d838..3f839679d2 100755 --- a/content/ja/docs/reference/glossary/docker.md +++ b/content/ja/docs/reference/glossary/docker.md @@ -4,14 +4,14 @@ id: docker date: 2018-04-12 full_link: https://docs.docker.com/engine/ short_description: > - Docker is a software technology providing operating-system-level virtualization also known as containers. + Dockerは、コンテナとして知られる、オペレーティングシステムレベルでの仮想化を提供するソフトウェア技術です。 aka: tags: - fundamental --- -Docker (specifically, Docker Engine) is a software technology providing operating-system-level virtualization also known as {{< glossary_tooltip text="containers" term_id="container" >}}. +Docker(正確にはDocker Engine)は、{{< glossary_tooltip text="コンテナ" term_id="container" >}}としても知られる、オペレーティングシステムレベルでの仮想化を提供するソフトウェア技術です。 -Docker uses the resource isolation features of the Linux kernel such as cgroups and kernel namespaces, and a union-capable file system such as OverlayFS and others to allow independent containers to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines (VMs). +Dockerは、croupsやカーネル名前空間などのLinuxカーネルのリソースの隔離機能、OverlayFSなどの統合能力のあるファイルシステム、独立したコンテナを単一のLinuxインスタンス内で実行可能にするその他の機能などを利用して、マシンレベルでの仮想マシン(VM)の起動にかかるオーバーヘッドを回避します。 diff --git a/content/ja/docs/reference/glossary/label.md b/content/ja/docs/reference/glossary/label.md new file mode 100755 index 0000000000..fa770ac291 --- /dev/null +++ b/content/ja/docs/reference/glossary/label.md @@ -0,0 +1,17 @@ +--- +title: ラベル +id: label +date: 2018-04-12 +full_link: /docs/concepts/overview/working-with-objects/labels +short_description: > + ユーザーにとって意味があり関連性のある識別属性を、オブジェクトにタグ付けするものです。 + +aka: +tags: +- fundamental +--- + ユーザーにとって意味があり関連性のある識別属性を、オブジェクトにタグ付けするものです。 + + + +ラベルは、{{< glossary_tooltip text="Pod" term_id="pod" >}}などのオブジェクトに付与されるキーと値のペアです。オブジェクトのサブセットを組織化したり選択したりするために使われます。 diff --git a/content/ja/docs/reference/glossary/mirror-pod.md b/content/ja/docs/reference/glossary/mirror-pod.md index c925e4d672..7f6c1ed5c8 100755 --- a/content/ja/docs/reference/glossary/mirror-pod.md +++ b/content/ja/docs/reference/glossary/mirror-pod.md @@ -1,21 +1,18 @@ --- -title: Mirror Pod +title: ミラーPod id: mirror-pod date: 2019-08-06 short_description: > - An object in the API server that tracks a static pod on a kubelet. + kubelet上のstatic Podを追跡するAPIサーバー内のオブジェクトです。 aka: tags: - fundamental --- - A {{< glossary_tooltip text="pod" term_id="pod" >}} object that a kubelet uses - to represent a {{< glossary_tooltip text="static pod" term_id="static-pod" >}} +kubeletが{{< glossary_tooltip text="static Pod" term_id="static-pod" >}}を代表するために使用する{{< glossary_tooltip text="Pod" term_id="pod" >}}オブジェクトです。 -When the kubelet finds a static pod in its configuration, it automatically tries to -create a Pod object on the Kubernetes API server for it. This means that the pod -will be visible on the API server, but cannot be controlled from there. +kubeletが設定の中にstatic Podを発見すると、static Podに対応するPodオブジェクトをKubernetes APIサーバー上に自動的に作成しようとします。つまり、APIサーバーからはPodが見えていますが、制御まではできないということです。 -(For example, removing a mirror pod will not stop the kubelet daemon from running it). +(たとえば、ミラーPodを削除しても、kubeletデーモンが対応するPodの実行を停止することはありません。) diff --git a/content/ja/docs/reference/glossary/selector.md b/content/ja/docs/reference/glossary/selector.md index 24d6bcdf53..a4fc039e1e 100755 --- a/content/ja/docs/reference/glossary/selector.md +++ b/content/ja/docs/reference/glossary/selector.md @@ -4,13 +4,13 @@ id: selector date: 2018-04-12 full_link: /docs/concepts/overview/working-with-objects/labels/ short_description: > - ユーザーはラベルに基づいてリソースのリストをフィルタリングできます。 + セレクターを利用すると、ユーザーはラベルに基づいてリソースのリストをフィルタリングできます。 aka: tags: - fundamental --- - ユーザーは{{< glossary_tooltip text="ラベル" term_id="label" >}}に基づいてリソースのリストをフィルタリングできます。 + セレクターを利用すると、ユーザーは{{< glossary_tooltip text="ラベル" term_id="label" >}}に基づいてリソースのリストをフィルタリングできます。 From 4bd57c70429969baae487c1d4f8e323ebc56941d Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sun, 16 Aug 2020 20:30:16 +0900 Subject: [PATCH 3/4] Translate tasks/configure-pod-container/static-pod into Japanese. --- .../configure-pod-container/static-pod.md | 126 +++++++----------- 1 file changed, 46 insertions(+), 80 deletions(-) diff --git a/content/ja/docs/tasks/configure-pod-container/static-pod.md b/content/ja/docs/tasks/configure-pod-container/static-pod.md index cf31d822d6..917927c8e0 100644 --- a/content/ja/docs/tasks/configure-pod-container/static-pod.md +++ b/content/ja/docs/tasks/configure-pod-container/static-pod.md @@ -1,7 +1,5 @@ --- -reviewers: -- jsafrane -title: Create static Pods +title: static Podを作成する weight: 170 content_type: task --- @@ -9,65 +7,44 @@ content_type: task -*Static Pods* are managed directly by the kubelet daemon on a specific node, -without the {{< glossary_tooltip text="API server" term_id="kube-apiserver" >}} -observing them. -Unlike Pods that are managed by the control plane (for example, a -{{< glossary_tooltip text="Deployment" term_id="deployment" >}}); -instead, the kubelet watches each static Pod (and restarts it if it fails). +*Static Pod*とは、{{< glossary_tooltip text="APIサーバー" term_id="kube-apiserver" >}}が監視せず、特定のノード上のkubeletデーモンによって直接管理されるPodです。コントロールプレーンに管理されるPod(たとえば{{< glossary_tooltip text="Deployment" term_id="deployment" >}}など)とは異なり、kubeletがそれぞれのstatic Podを監視(および障害時には再起動)します。 -Static Pods are always bound to one {{< glossary_tooltip term_id="kubelet" >}} on a specific node. +Static Podは、常に特定のノード上の1つの{{< glossary_tooltip term_id="kubelet" >}}に紐付けられます。 -The kubelet automatically tries to create a {{< glossary_tooltip text="mirror Pod" term_id="mirror-pod" >}} -on the Kubernetes API server for each static Pod. -This means that the Pods running on a node are visible on the API server, -but cannot be controlled from there. +kubeletは、各static Podに対して、自動的にKubernetes APIサーバー上に{{< glossary_tooltip text="ミラーPod" term_id="mirror-pod" >}}の作成を試みます。つまり、ノード上で実行中のPodはAPIサーバーから検出されますが、APIサーバー自身から制御されることはないということです。 {{< note >}} -If you are running clustered Kubernetes and are using static -Pods to run a Pod on every node, you should probably be using a -{{< glossary_tooltip text="DaemonSet" term_id="daemonset" >}} -instead. +複数ノードからなるKubernetesクラスターを実行していて、Podをすべてのノード上で実行するためにstatic Podを使用している場合、おそらくstatic Podの代わりに{{< glossary_tooltip text="DaemonSet" term_id="daemonset" >}}を使用するべきでしょう。 {{< /note >}} - - ## {{% heading "prerequisites" %}} - {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -This page assumes you're using {{< glossary_tooltip term_id="docker" >}} to run Pods, -and that your nodes are running the Fedora operating system. -Instructions for other distributions or Kubernetes installations may vary. - - - - +このページの説明では、Podを実行するために{{< glossary_tooltip term_id="docker" >}}を使用しており、ノード上のOSがFedoraであることを前提としています。他のディストリビューションやKubernetesのインストール方法によっては、操作が異なる場合があります。 -## Create a static pod {#static-pod-creation} +## static Podを作成する {#static-pod-creation} -You can configure a static Pod with either a [file system hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#configuration-files) or a [web hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#pods-created-via-http). +static Podは、[ファイルシステム上でホストされた設定ファイル](#configuration-files)または[ウェブ上でホストされた設定ファイル](/#pods-created-via-http)を使用して設定できます。 -### Filesystem-hosted static Pod manifest {#configuration-files} +### ファイルシステム上でホストされたstatic Podマニフェスト {#configuration-files} -Manifests are standard Pod definitions in JSON or YAML format in a specific directory. Use the `staticPodPath: ` field in the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file), which periodically scans the directory and creates/deletes static Pods as YAML/JSON files appear/disappear there. -Note that the kubelet will ignore files starting with dots when scanning the specified directory. +マニフェストは、JSONまたはYAML形式の標準のPod定義で、特定のディレクトリに置きます。[kubeletの設定ファイル](/docs/tasks/administer-cluster/kubelet-config-file)の中で、`staticPodPath: <ディレクトリの場所>`というフィールドを使用すると、kubeletがこのディレクトリを定期的にスキャンして、YAML/JSONファイルが作成/削除されるたびに、static Podの作成/削除が行われるようになります。指定したディレクトリをスキャンする際、kubeletはドットから始まる名前のファイルを無視することに注意してください。 -For example, this is how to start a simple web server as a static Pod: +例として、単純なウェブサーバーをstatic Podとして実行する方法を示します。 -1. Choose a node where you want to run the static Pod. In this example, it's `my-node1`. +1. static Podを実行したいノードを選択します。この例では、`my-node1`です。 ```shell ssh my-node1 ``` -2. Choose a directory, say `/etc/kubelet.d` and place a web server Pod definition there, for example `/etc/kubelet.d/static-web.yaml`: +2. ディレクトリを選び(ここでは`/etc/kubelet.d`とします)、ここにウェブサーバーのPodの定義を置きます。たとえば、`/etc/kubelet.d/static-web.yaml`に置きます。 ```shell - # Run this command on the node where kubelet is running + # このコマンドは、kubeletが実行中のノード上で実行してください mkdir /etc/kubelet.d/ cat </etc/kubelet.d/static-web.yaml apiVersion: v1 @@ -87,31 +64,28 @@ For example, this is how to start a simple web server as a static Pod: EOF ``` -3. Configure your kubelet on the node to use this directory by running it with `--pod-manifest-path=/etc/kubelet.d/` argument. On Fedora edit `/etc/kubernetes/kubelet` to include this line: +3. ノード上のkubeletがこのディレクトリを使用するようにするために、`--pod-manifest-path=/etc/kubelet.d/`引数を付けてkubeletを実行するように設定します。Fedoraの場合、次の行が含まれるように`/etc/kubernetes/kubelet`を編集します。 ``` KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --pod-manifest-path=/etc/kubelet.d/" ``` - or add the `staticPodPath: ` field in the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file). -4. Restart the kubelet. On Fedora, you would run: + あるいは、[kubeletの設定ファイル](/docs/tasks/administer-cluster/kubelet-config-file)に、`staticPodPath: <ディレクトリの場所>`フィールドを追加することでも設定できます。 + +4. kubeletを再起動します。Fedoraの場合、次のコマンドを実行します。 ```shell - # Run this command on the node where the kubelet is running + # このコマンドは、kubeletが実行中のノード上で実行してください systemctl restart kubelet ``` -### Web-hosted static pod manifest {#pods-created-via-http} +### ウェブ上でホストされたstatic Podマニフェスト {#pods-created-via-http} -Kubelet periodically downloads a file specified by `--manifest-url=` argument -and interprets it as a JSON/YAML file that contains Pod definitions. -Similar to how [filesystem-hosted manifests](#configuration-files) work, the kubelet -refetches the manifest on a schedule. If there are changes to the list of static -Pods, the kubelet applies them. +kubeletは、`--manifest-url=`引数で指定されたファイルを定期的にダウンロードし、Podの定義が含まれたJSON/YAMLファイルとして解釈します。kubeletは、[ファイルシステム上でホストされたマニフェスト](#configuration-files)での動作方法と同じように、定期的にマニフェストを再取得します。static Podのリスト中に変更が見つかると、kubeletがその変更を適用します。 -To use this approach: +このアプローチを採用する場合、次のように設定します。 -1. Create a YAML file and store it on a web server so that you can pass the URL of that file to the kubelet. +1. YAMLファイルを作成し、kubeletにファイルのURLを渡せるようにするために、ウェブサーバー上に保存する。 ```yaml apiVersion: v1 @@ -130,39 +104,38 @@ To use this approach: protocol: TCP ``` -2. Configure the kubelet on your selected node to use this web manifest by running it with `--manifest-url=`. On Fedora, edit `/etc/kubernetes/kubelet` to include this line: +2. 選択したノード上のkubeletを`--manifest-url=`を使用して実行することで、このウェブ上のマニフェストを使用するように設定する。Fedoraの場合、`/etc/kubernetes/kubelet`に次の行が含まれるように編集します。 ``` - KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --manifest-url=" + KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --manifest-url=<マニフェストのURL" ``` -3. Restart the kubelet. On Fedora, you would run: +3. kubeletを再起動する。Fedoraの場合、次のコマンドを実行します。 ```shell - # Run this command on the node where the kubelet is running + # このコマンドは、kubeletが実行中のノード上で実行してください systemctl restart kubelet ``` -## Observe static pod behavior {#behavior-of-static-pods} +## static Podの動作を観察する {#behavior-of-static-pods} -When the kubelet starts, it automatically starts all defined static Pods. As you have -defined a static Pod and restarted the kubelet, the new static Pod should -already be running. +kubeletが起動すると、定義されたすべてのstatic Podを起動します。ここまででstatic Podを設定してkubeletを再起動したため、すでに新しいstatic Podが実行中になっているはずです。 + +次のコマンドを(ノード上で)実行することで、(static Podを含む)実行中のコンテナを確認できます。 -You can view running containers (including static Pods) by running (on the node): ```shell -# Run this command on the node where the kubelet is running +# このコマンドは、kubeletが実行中のノード上で実行してください docker ps ``` -The output might be something like: +出力は次のようになります。 ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f6d05272b57e nginx:latest "nginx" 8 minutes ago Up 8 minutes k8s_web.6f802af4_static-web-fk-node1_default_67e24ed9466ba55986d120c867395f3c_378e5f3c ``` -You can see the mirror Pod on the API server: +APIサーバー上では、ミラーPodを確認できます。 ```shell kubectl get pods @@ -173,17 +146,13 @@ static-web-my-node1 1/1 Running 0 2m ``` {{< note >}} -Make sure the kubelet has permission to create the mirror Pod in the API server. If not, the creation request is rejected by the API server. See -[PodSecurityPolicy](/docs/concepts/policy/pod-security-policy/). +kubeletにAPIサーバー上のミラーPodを作成する権限があることを確認してください。もし権限がない場合、APIサーバーによって作成のリクエストが拒否されてしまいます。詳しくは、[PodSecurityPolicy](/docs/concepts/policy/pod-security-policy/)を参照してください。 {{< /note >}} -{{< glossary_tooltip term_id="label" text="Labels" >}} from the static Pod are -propagated into the mirror Pod. You can use those labels as normal via -{{< glossary_tooltip term_id="selector" text="selectors" >}}, etc. +static Podに付けた{{< glossary_tooltip term_id="label" text="ラベル" >}}はミラーPodに伝搬します。ミラーPodに付けたラベルは、通常のPodと同じように{{< glossary_tooltip term_id="selector" text="セレクター" >}}などから利用できます。 -If you try to use `kubectl` to delete the mirror Pod from the API server, -the kubelet _doesn't_ remove the static Pod: +もし`kubectl`を使用してAPIサーバーからミラーPodを削除しようとしても、kubeletはstatic Podを削除*しません*。 ```shell kubectl delete pod static-web-my-node1 @@ -191,7 +160,9 @@ kubectl delete pod static-web-my-node1 ``` pod "static-web-my-node1" deleted ``` -You can see that the Pod is still running: + +Podはまだ実行中であることがわかります。 + ```shell kubectl get pods ``` @@ -200,14 +171,11 @@ NAME READY STATUS RESTARTS AGE static-web-my-node1 1/1 Running 0 12s ``` -Back on your node where the kubelet is running, you can try to stop the Docker -container manually. -You'll see that, after a time, the kubelet will notice and will restart the Pod -automatically: +kubeletが実行中のノードに戻り、Dockerコンテナを手動で停止してみることができます。しばらくすると、kubeletが変化に気づき、Podを自動的に再起動することがわかります。 ```shell -# Run these commands on the node where the kubelet is running -docker stop f6d05272b57e # replace with the ID of your container +# このコマンドは、kubeletが実行中のノード上で実行してください +docker stop f6d05272b57e # 実際のコンテナIDと置き換えてください sleep 20 docker ps ``` @@ -216,13 +184,13 @@ CONTAINER ID IMAGE COMMAND CREATED ... 5b920cbaf8b1 nginx:latest "nginx -g 'daemon of 2 seconds ago ... ``` -## Dynamic addition and removal of static pods +## static Podの動的な追加と削除 -The running kubelet periodically scans the configured directory (`/etc/kubelet.d` in our example) for changes and adds/removes Pods as files appear/disappear in this directory. +実行中のkubeletは設定ディレクトリ(この例では`/etc/kubelet.d`)の変更を定期的にスキャンし、このディレクトリ内にファイルが追加/削除されると、Podの追加/削除を行います。 ```shell # This assumes you are using filesystem-hosted static Pod configuration -# Run these commands on the node where the kubelet is running +# このコマンドは、kubeletが実行中のノード上で実行してください # mv /etc/kubelet.d/static-web.yaml /tmp sleep 20 @@ -236,5 +204,3 @@ docker ps CONTAINER ID IMAGE COMMAND CREATED ... e7a62e3427f1 nginx:latest "nginx -g 'daemon of 27 seconds ago ``` - - From 02723a22c452b99f74ec97785e55df9a17385d53 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Tue, 18 Aug 2020 14:30:01 +0900 Subject: [PATCH 4/4] Fix a typo Co-authored-by: inductor(Kohei) --- content/ja/docs/reference/glossary/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/ja/docs/reference/glossary/docker.md b/content/ja/docs/reference/glossary/docker.md index 3f839679d2..77f24ad6b8 100755 --- a/content/ja/docs/reference/glossary/docker.md +++ b/content/ja/docs/reference/glossary/docker.md @@ -14,4 +14,4 @@ Docker(正確にはDocker Engine)は、{{< glossary_tooltip text="コンテナ" -Dockerは、croupsやカーネル名前空間などのLinuxカーネルのリソースの隔離機能、OverlayFSなどの統合能力のあるファイルシステム、独立したコンテナを単一のLinuxインスタンス内で実行可能にするその他の機能などを利用して、マシンレベルでの仮想マシン(VM)の起動にかかるオーバーヘッドを回避します。 +Dockerは、cgroupsやカーネル名前空間などのLinuxカーネルのリソースの隔離機能、OverlayFSなどの統合能力のあるファイルシステム、独立したコンテナを単一のLinuxインスタンス内で実行可能にするその他の機能などを利用して、マシンレベルでの仮想マシン(VM)の起動にかかるオーバーヘッドを回避します。