Skip to content

Commit 4bd57c7

Browse files
committed
Translate tasks/configure-pod-container/static-pod into Japanese.
1 parent 2803a7b commit 4bd57c7

File tree

1 file changed

+46
-80
lines changed

1 file changed

+46
-80
lines changed
Lines changed: 46 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,50 @@
11
---
2-
reviewers:
3-
- jsafrane
4-
title: Create static Pods
2+
title: static Podを作成する
53
weight: 170
64
content_type: task
75
---
86

97
<!-- overview -->
108

119

12-
*Static Pods* are managed directly by the kubelet daemon on a specific node,
13-
without the {{< glossary_tooltip text="API server" term_id="kube-apiserver" >}}
14-
observing them.
15-
Unlike Pods that are managed by the control plane (for example, a
16-
{{< glossary_tooltip text="Deployment" term_id="deployment" >}});
17-
instead, the kubelet watches each static Pod (and restarts it if it fails).
10+
*Static Pod*とは、{{< glossary_tooltip text="APIサーバー" term_id="kube-apiserver" >}}が監視せず、特定のノード上のkubeletデーモンによって直接管理されるPodです。コントロールプレーンに管理されるPod(たとえば{{< glossary_tooltip text="Deployment" term_id="deployment" >}}など)とは異なり、kubeletがそれぞれのstatic Podを監視(および障害時には再起動)します。
1811

19-
Static Pods are always bound to one {{< glossary_tooltip term_id="kubelet" >}} on a specific node.
12+
Static Podは、常に特定のノード上の1つの{{< glossary_tooltip term_id="kubelet" >}}に紐付けられます。
2013

21-
The kubelet automatically tries to create a {{< glossary_tooltip text="mirror Pod" term_id="mirror-pod" >}}
22-
on the Kubernetes API server for each static Pod.
23-
This means that the Pods running on a node are visible on the API server,
24-
but cannot be controlled from there.
14+
kubeletは、各static Podに対して、自動的にKubernetes APIサーバー上に{{< glossary_tooltip text="ミラーPod" term_id="mirror-pod" >}}の作成を試みます。つまり、ノード上で実行中のPodはAPIサーバーから検出されますが、APIサーバー自身から制御されることはないということです。
2515

2616
{{< note >}}
27-
If you are running clustered Kubernetes and are using static
28-
Pods to run a Pod on every node, you should probably be using a
29-
{{< glossary_tooltip text="DaemonSet" term_id="daemonset" >}}
30-
instead.
17+
複数ノードからなるKubernetesクラスターを実行していて、Podをすべてのノード上で実行するためにstatic Podを使用している場合、おそらくstatic Podの代わりに{{< glossary_tooltip text="DaemonSet" term_id="daemonset" >}}を使用するべきでしょう。
3118
{{< /note >}}
3219

33-
34-
3520
## {{% heading "prerequisites" %}}
3621

37-
3822
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
3923

40-
This page assumes you're using {{< glossary_tooltip term_id="docker" >}} to run Pods,
41-
and that your nodes are running the Fedora operating system.
42-
Instructions for other distributions or Kubernetes installations may vary.
43-
44-
45-
46-
24+
このページの説明では、Podを実行するために{{< glossary_tooltip term_id="docker" >}}を使用しており、ノード上のOSがFedoraであることを前提としています。他のディストリビューションやKubernetesのインストール方法によっては、操作が異なる場合があります。
4725

4826
<!-- steps -->
4927

50-
## Create a static pod {#static-pod-creation}
28+
## static Podを作成する {#static-pod-creation}
5129

52-
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).
30+
static Podは、[ファイルシステム上でホストされた設定ファイル](#configuration-files)または[ウェブ上でホストされた設定ファイル](/#pods-created-via-http)を使用して設定できます。
5331

54-
### Filesystem-hosted static Pod manifest {#configuration-files}
32+
### ファイルシステム上でホストされたstatic Podマニフェスト {#configuration-files}
5533

56-
Manifests are standard Pod definitions in JSON or YAML format in a specific directory. Use the `staticPodPath: <the directory>` 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.
57-
Note that the kubelet will ignore files starting with dots when scanning the specified directory.
34+
マニフェストは、JSONまたはYAML形式の標準のPod定義で、特定のディレクトリに置きます。[kubeletの設定ファイル](/docs/tasks/administer-cluster/kubelet-config-file)の中で、`staticPodPath: <ディレクトリの場所>`というフィールドを使用すると、kubeletがこのディレクトリを定期的にスキャンして、YAML/JSONファイルが作成/削除されるたびに、static Podの作成/削除が行われるようになります。指定したディレクトリをスキャンする際、kubeletはドットから始まる名前のファイルを無視することに注意してください。
5835

59-
For example, this is how to start a simple web server as a static Pod:
36+
例として、単純なウェブサーバーをstatic Podとして実行する方法を示します。
6037

61-
1. Choose a node where you want to run the static Pod. In this example, it's `my-node1`.
38+
1. static Podを実行したいノードを選択します。この例では、`my-node1`です。
6239

6340
```shell
6441
ssh my-node1
6542
```
6643

67-
2. Choose a directory, say `/etc/kubelet.d` and place a web server Pod definition there, for example `/etc/kubelet.d/static-web.yaml`:
44+
2. ディレクトリを選び(ここでは`/etc/kubelet.d`とします)、ここにウェブサーバーのPodの定義を置きます。たとえば、`/etc/kubelet.d/static-web.yaml`に置きます。
6845

6946
```shell
70-
# Run this command on the node where kubelet is running
47+
# このコマンドは、kubeletが実行中のノード上で実行してください
7148
mkdir /etc/kubelet.d/
7249
cat <<EOF >/etc/kubelet.d/static-web.yaml
7350
apiVersion: v1
@@ -87,31 +64,28 @@ For example, this is how to start a simple web server as a static Pod:
8764
EOF
8865
```
8966
90-
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:
67+
3. ノード上のkubeletがこのディレクトリを使用するようにするために、`--pod-manifest-path=/etc/kubelet.d/`引数を付けてkubeletを実行するように設定します。Fedoraの場合、次の行が含まれるように`/etc/kubernetes/kubelet`を編集します。
9168
9269
```
9370
KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --pod-manifest-path=/etc/kubelet.d/"
9471
```
95-
or add the `staticPodPath: <the directory>` field in the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file).
9672
97-
4. Restart the kubelet. On Fedora, you would run:
73+
あるいは、[kubeletの設定ファイル](/docs/tasks/administer-cluster/kubelet-config-file)に、`staticPodPath: <ディレクトリの場所>`フィールドを追加することでも設定できます。
74+
75+
4. kubeletを再起動します。Fedoraの場合、次のコマンドを実行します。
9876
9977
```shell
100-
# Run this command on the node where the kubelet is running
78+
# このコマンドは、kubeletが実行中のノード上で実行してください
10179
systemctl restart kubelet
10280
```
10381
104-
### Web-hosted static pod manifest {#pods-created-via-http}
82+
### ウェブ上でホストされたstatic Podマニフェスト {#pods-created-via-http}
10583
106-
Kubelet periodically downloads a file specified by `--manifest-url=<URL>` argument
107-
and interprets it as a JSON/YAML file that contains Pod definitions.
108-
Similar to how [filesystem-hosted manifests](#configuration-files) work, the kubelet
109-
refetches the manifest on a schedule. If there are changes to the list of static
110-
Pods, the kubelet applies them.
84+
kubeletは、`--manifest-url=<URL>`引数で指定されたファイルを定期的にダウンロードし、Podの定義が含まれたJSON/YAMLファイルとして解釈します。kubeletは、[ファイルシステム上でホストされたマニフェスト](#configuration-files)での動作方法と同じように、定期的にマニフェストを再取得します。static Podのリスト中に変更が見つかると、kubeletがその変更を適用します。
11185
112-
To use this approach:
86+
このアプローチを採用する場合、次のように設定します。
11387
114-
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.
88+
1. YAMLファイルを作成し、kubeletにファイルのURLを渡せるようにするために、ウェブサーバー上に保存する。
11589
11690
```yaml
11791
apiVersion: v1
@@ -130,39 +104,38 @@ To use this approach:
130104
protocol: TCP
131105
```
132106
133-
2. Configure the kubelet on your selected node to use this web manifest by running it with `--manifest-url=<manifest-url>`. On Fedora, edit `/etc/kubernetes/kubelet` to include this line:
107+
2. 選択したノード上のkubeletを`--manifest-url=<manifest-url>`を使用して実行することで、このウェブ上のマニフェストを使用するように設定する。Fedoraの場合、`/etc/kubernetes/kubelet`に次の行が含まれるように編集します。
134108
135109
```
136-
KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --manifest-url=<manifest-url>"
110+
KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --manifest-url=<マニフェストのURL"
137111
```
138112
139-
3. Restart the kubelet. On Fedora, you would run:
113+
3. kubeletを再起動する。Fedoraの場合、次のコマンドを実行します。
140114
141115
```shell
142-
# Run this command on the node where the kubelet is running
116+
# このコマンドは、kubeletが実行中のノード上で実行してください
143117
systemctl restart kubelet
144118
```
145119
146-
## Observe static pod behavior {#behavior-of-static-pods}
120+
## static Podの動作を観察する {#behavior-of-static-pods}
121+
122+
kubeletが起動すると、定義されたすべてのstatic Podを起動します。ここまででstatic Podを設定してkubeletを再起動したため、すでに新しいstatic Podが実行中になっているはずです。
147123
148-
When the kubelet starts, it automatically starts all defined static Pods. As you have
149-
defined a static Pod and restarted the kubelet, the new static Pod should
150-
already be running.
124+
次のコマンドを(ノード上で)実行することで、(static Podを含む)実行中のコンテナを確認できます。
151125
152-
You can view running containers (including static Pods) by running (on the node):
153126
```shell
154-
# Run this command on the node where the kubelet is running
127+
# このコマンドは、kubeletが実行中のノード上で実行してください
155128
docker ps
156129
```
157130
158-
The output might be something like:
131+
出力は次のようになります。
159132
160133
```
161134
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
162135
f6d05272b57e nginx:latest "nginx" 8 minutes ago Up 8 minutes k8s_web.6f802af4_static-web-fk-node1_default_67e24ed9466ba55986d120c867395f3c_378e5f3c
163136
```
164137
165-
You can see the mirror Pod on the API server:
138+
APIサーバー上では、ミラーPodを確認できます。
166139
167140
```shell
168141
kubectl get pods
@@ -173,25 +146,23 @@ static-web-my-node1 1/1 Running 0 2m
173146
```
174147
175148
{{< note >}}
176-
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
177-
[PodSecurityPolicy](/docs/concepts/policy/pod-security-policy/).
149+
kubeletにAPIサーバー上のミラーPodを作成する権限があることを確認してください。もし権限がない場合、APIサーバーによって作成のリクエストが拒否されてしまいます。詳しくは、[PodSecurityPolicy](/docs/concepts/policy/pod-security-policy/)を参照してください。
178150
{{< /note >}}
179151
180152
181-
{{< glossary_tooltip term_id="label" text="Labels" >}} from the static Pod are
182-
propagated into the mirror Pod. You can use those labels as normal via
183-
{{< glossary_tooltip term_id="selector" text="selectors" >}}, etc.
153+
static Podに付けた{{< glossary_tooltip term_id="label" text="ラベル" >}}はミラーPodに伝搬します。ミラーPodに付けたラベルは、通常のPodと同じように{{< glossary_tooltip term_id="selector" text="セレクター" >}}などから利用できます。
184154
185-
If you try to use `kubectl` to delete the mirror Pod from the API server,
186-
the kubelet _doesn't_ remove the static Pod:
155+
もし`kubectl`を使用してAPIサーバーからミラーPodを削除しようとしても、kubeletはstatic Podを削除*しません*
187156
188157
```shell
189158
kubectl delete pod static-web-my-node1
190159
```
191160
```
192161
pod "static-web-my-node1" deleted
193162
```
194-
You can see that the Pod is still running:
163+
164+
Podはまだ実行中であることがわかります。
165+
195166
```shell
196167
kubectl get pods
197168
```
@@ -200,14 +171,11 @@ NAME READY STATUS RESTARTS AGE
200171
static-web-my-node1 1/1 Running 0 12s
201172
```
202173
203-
Back on your node where the kubelet is running, you can try to stop the Docker
204-
container manually.
205-
You'll see that, after a time, the kubelet will notice and will restart the Pod
206-
automatically:
174+
kubeletが実行中のノードに戻り、Dockerコンテナを手動で停止してみることができます。しばらくすると、kubeletが変化に気づき、Podを自動的に再起動することがわかります。
207175
208176
```shell
209-
# Run these commands on the node where the kubelet is running
210-
docker stop f6d05272b57e # replace with the ID of your container
177+
# このコマンドは、kubeletが実行中のノード上で実行してください
178+
docker stop f6d05272b57e # 実際のコンテナIDと置き換えてください
211179
sleep 20
212180
docker ps
213181
```
@@ -216,13 +184,13 @@ CONTAINER ID IMAGE COMMAND CREATED ...
216184
5b920cbaf8b1 nginx:latest "nginx -g 'daemon of 2 seconds ago ...
217185
```
218186
219-
## Dynamic addition and removal of static pods
187+
## static Podの動的な追加と削除
220188
221-
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.
189+
実行中のkubeletは設定ディレクトリ(この例では`/etc/kubelet.d`)の変更を定期的にスキャンし、このディレクトリ内にファイルが追加/削除されると、Podの追加/削除を行います。
222190
223191
```shell
224192
# This assumes you are using filesystem-hosted static Pod configuration
225-
# Run these commands on the node where the kubelet is running
193+
# このコマンドは、kubeletが実行中のノード上で実行してください
226194
#
227195
mv /etc/kubelet.d/static-web.yaml /tmp
228196
sleep 20
@@ -236,5 +204,3 @@ docker ps
236204
CONTAINER ID IMAGE COMMAND CREATED ...
237205
e7a62e3427f1 nginx:latest "nginx -g 'daemon of 27 seconds ago
238206
```
239-
240-

0 commit comments

Comments
 (0)