-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate concepts/workloads/pods/pod-overview/ in Japanese (#14426) #14494
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,122 @@ | ||||||
--- | ||||||
reviewers: | ||||||
- erictune | ||||||
title: Podについての概観(Pod Overview) | ||||||
content_template: templates/concept | ||||||
weight: 10 | ||||||
card: | ||||||
name: concepts | ||||||
weight: 60 | ||||||
--- | ||||||
|
||||||
{{% capture overview %}} | ||||||
このページでは、Kubernetesのオブジェクトモデルにおいて、デプロイ可能な最小単位のオブジェクトである`Pod`に関して概観します。 | ||||||
{{% /capture %}} | ||||||
|
||||||
|
||||||
{{% capture body %}} | ||||||
## Podについて理解する | ||||||
|
||||||
*Pod* は、Kubernetesの基本的なビルディングブロックとなります。Kubernetesオブジェクトモデルの中で、ユーザーが作成し、デプロイ可能なシンプルで最も最小のユニットです。単一のPodはクラスタ上で稼働する単一のプロセスを表現します。 | ||||||
|
||||||
単一のPodは、アプリケーションコンテナ(いくつかの場合においては複数のコンテナ)や、ストレージリソース、ユニークなネットワークIPや、コンテナがどのように稼働すべきか統制するためのオプションをカプセル化します。単一のPodは、ある単一のDeploymentのユニット(単一のコンテナもしくはリソースを共有する、密接に連携された少数のコンテナ群を含むような*Kubernetes内でのアプリケーションの単一のインスタンス*) を表現します。 | ||||||
|
||||||
> [Docker](https://www.docker.com)はKubernetesのPod内で使われる最も一般的なコンテナランタイムですが、Podは他のコンテナランタイムも同様にサポートしています。 | ||||||
|
||||||
Kubernetesクラスタ内でのPodは2つの主な方法で使うことができます。 | ||||||
|
||||||
* **単一のコンテナを稼働させるPod** : いわゆる*「1Pod1コンテナ」* 構成のモデルは、最も一般的なKubernetesのユースケースです。 | ||||||
このケースでは、ユーザーはPodを単一のコンテナのラッパーとして考えることができ、Kubernetesはコンテナを直接扱うというよりは、Podを管理することになります。 | ||||||
* **協調して稼働させる必要がある複数のコンテナを稼働させるPod** : 単一のPodは、リソースを共有する必要があるような、密接に連携した複数の同じ環境にあるコンテナからなるアプリケーションをカプセル化することもできます。 これらの同じ環境にあるコンテナ群は、サービスの結合力の強いユニットを構成することができます。 | ||||||
-- 1つのコンテナが、共有されたボリュームからファイルをパブリックな場所に送信し、一方では分割された*サイドカー* コンテナがそれらのファイルを更新します。そのPodはそれらのコンテナとストレージリソースを、単一の管理可能なエンティティとしてまとめます。 | ||||||
|
||||||
[Kubernetes Blog](http://kubernetes.io/blog)にて、Podのユースケースに関するいくつかの追加情報を見ることができます。 | ||||||
さらなる情報を得たい場合は、下記のページを参照ください。 | ||||||
|
||||||
* [The Distributed System Toolkit: Patterns for Composite Containers](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns) | ||||||
* [Container Design Patterns](https://kubernetes.io/blog/2016/06/container-design-patterns) | ||||||
|
||||||
各Podは、与えられたアプリケーションの単一のインスタンスを稼働するためのものです。もしユーザーのアプリケーションを水平にスケーリングさせたい場合(例: 複数インスタンスを稼働させる)、複数のPodを使うべきです。1つのPodは各インスタンスに対応しています。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
日本語的に「スケールさせたい場合」でもいい気がするんですが、どっちがいいですかね・・・・? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
こちらですが、再度読み直しましたが、ご指摘の通り 「スケールさせたい場合」の方が読みやすいと思いましたので、修正いたします。 |
||||||
Kubernetesにおいて、これは一般的に_レプリケーション_ と呼ばれます。 | ||||||
レプリケーションされたPodは、通常コントローラと呼ばれる抽象概念によって単一のグループとして作成、管理されます。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
さらなる情報に関しては[Podとコントローラ](#pods-and-controllers)を参照して下さい。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
### Podがどのように複数のコンテナを管理しているか | ||||||
|
||||||
Podは凝集性の高いサービスのユニットを構成するような複数の協調プロセス(コンテナ)をサポートするためにデザインされました。 | ||||||
単一のPod内のコンテナ群は、クラスタ内において同一の物理マシンもしくは仮想マシン上において自動で同じ環境に配備され、スケジュールされます。コンテナはリソースや依存関係を共有し、お互いにコミュニケートし、それらがいつ、どのように削除されるかを調整できます。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
注意点として、単一のPod内で同じ環境に配備され、同時管理される複数のコンテナをグルーピングするのは、比較的に発展的なユースケースとなります。 | ||||||
ユーザーは、コンテナ群が密接に連携するような、特定のインスタンスにおいてのみこのパターンを使用するべきです。 | ||||||
例えば、ユーザーが共有ボリューム内にあるファイル用のWebサーバとして稼働するコンテナと、下記のダイアグラムにあるような、リモートのソースからファイルを更新するような分離された*サイドカー* コンテナを持っているような場合です。 | ||||||
|
||||||
|
||||||
{{< figure src="/images/docs/pod.svg" title="Podのダイアグラム" width="50%" >}} | ||||||
|
||||||
Podは、Podによって構成されたコンテナ群のために2種類の共有リソースを提供します。 *ネットワーキング* と*ストレージ* です。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. スペースの位置が不思議に見えますが、意図的なモノでしょうか? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. こちらについてですが、意図的にスペースをいれています。 make serveでローカルでサーバを立てて表示の確認をしています。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _ で囲んだ文字列についても同様となります。 |
||||||
|
||||||
#### ネットワーキング | ||||||
|
||||||
各Podは固有のIPアドレスを割り当てられます。単一のPod内の各コンテナは、IPアドレスやネットワークポートを含む、そのネットワークの名前空間を共有します。*Pod内の* コンテナは`localhost`を使用してお互いに疎通できます。単一のPod内のコンテナが*Pod外* のエンティティと疎通する場合、共有されたネットワークリソース(ポートなど)をどのように使うかに関して調整しなければなりません。 | ||||||
|
||||||
#### ストレージ | ||||||
|
||||||
単一のPodは共有されたストレージ*ボリューム* のセットを指定できます。Pod内の全てのコンテナは、その共有されたボリュームにアクセスでき、コンテナ間でデータを共有することを可能にします。ボリュームもまた、もしPod内のコンテナの1つが再起動が必要になった場合に備えて、データを永続化できます。 | ||||||
単一のPod内での共有ストレージをKubernetesがどう実装しているかについてのさらなる情報については、[Volumes](/docs/concepts/storage/volumes/)を参照してください。 | ||||||
|
||||||
## Podを利用する | ||||||
|
||||||
ユーザーはまれに、Kubenetes内で独立したPodを直接作成する場合があります(シングルトンPodなど)。 | ||||||
これはPodが比較的、一時的な使い捨てエンティティとしてデザインされているためです。Podが作成された時(ユーザーによって直接的、またはコントローラによって間接的に作成された場合)、ユーザーのクラスタ内の単一のNode上で稼働するようにスケジューリングされます。そのPodはプロセスが停止されたり、Podオブジェクトが削除されたり、Podがリソースの欠如のために*追い出され* たり、Nodeが故障するまでNode上に残り続けます。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
{{< note >}} | ||||||
単一のPod内でのコンテナを再起動することと、そのPodを再起動することを混同しないでください。Podはそれ自体は実行されませんが、コンテナが実行される環境であり、削除されるまで存在し続けます。 | ||||||
{{< /note >}} | ||||||
|
||||||
Podは、Podそれ自体によって自己修復しません。もし、稼働されていないNode上にPodがスケジュールされた場合や、スケジューリング操作自体が失敗した場合、Podが削除されます。同様に、Podはリソースの欠如や、Nodeのメンテナンスによる追い出しがあった場合はそこで停止します。Kubernetesは*コントローラ* と呼ばれる高レベルの抽象概念を使用し、それは比較的使い捨て可能なPodインスタンスの管理を行います。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
このように、Podを直接使うのは可能ですが、コントローラを使用したPodを管理する方がより一般的です。KubernetesがPodのスケーリングと修復機能を実現するためにコントローラをどのように使うかに関する情報は[Podとコントローラ](#pods-and-controllers)を参照してください。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
### Podとコントローラ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
単一のコントローラは、ユーザーのために複数のPodを作成・管理し、レプリケーションやロールアウト、クラスタのスコープ内で自己修復の機能をハンドリングします。例えば、もしNodeが故障した場合、コントローラは異なるNode上にPodを置き換えるようにスケジューリングすることで、自動的にリプレース可能となります。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
1つまたはそれ以上のPodを含むコントローラの例は下記の通りです。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Some examples of Controllers that contain one or more pods include: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. こちら削除いたします。 |
||||||
|
||||||
* [Deployment](/docs/concepts/workloads/controllers/deployment/) | ||||||
* [StatefulSet](/docs/concepts/workloads/controllers/statefulset/) | ||||||
* [DaemonSet](/docs/concepts/workloads/controllers/daemonset/) | ||||||
|
||||||
通常は、コントローラはユーザーが作成したPodテンプレートを使用して、担当するPodを作成します。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## Podテンプレート | ||||||
|
||||||
Podテンプレートは、[ReplicationController](/docs/concepts/workloads/controllers/replicationcontroller/)、 [Job](/docs/concepts/jobs/run-to-completion-finite-workloads/)や、 | ||||||
[DaemonSet](/docs/concepts/workloads/controllers/daemonset/)のような他のオブジェクト内で含まれるPodの仕様となります。 | ||||||
コントローラは実際のPodを作成するためにPodテンプレートを使用します。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
下記のサンプルは、メッセージを表示する単一のコンテナを含んだ、シンプルなPodのマニフェストとなります。 | ||||||
|
||||||
```yaml | ||||||
apiVersion: v1 | ||||||
kind: Pod | ||||||
metadata: | ||||||
name: myapp-pod | ||||||
labels: | ||||||
app: myapp | ||||||
spec: | ||||||
containers: | ||||||
- name: myapp-container | ||||||
image: busybox | ||||||
command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 3600'] | ||||||
``` | ||||||
|
||||||
全てのレプリカの現在の理想的な状態を指定するというよりも、Podテンプレートはクッキーの抜き型のようなものです。一度クッキーがカットされると、そのクッキーは抜き型から離れて関係が無くなります。そこにはいわゆる”量子もつれ”といったものはありません。テンプレートに対するその後の変更や新しいテンプレートへの切り替えは、すでに作成されたPod上には直接的な影響はありません。 | ||||||
同様に、レプリケーションコントローラによって作成されたPodは、変更後に直接更新されます。これはPodとの意図的な違いとなり、そのPodに属する全てのコンテナの現在の理想的な状態を指定します。このアプローチは根本的にシステムのセマンティクスを単純化し、機能の柔軟性を高めます。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. レプリケーションコントローラ → ReplicationController と修正します |
||||||
|
||||||
{{% /capture %}} | ||||||
|
||||||
{{% capture whatsnext %}} | ||||||
* Podの振る舞いに関して学ぶには下記を参照してください。 | ||||||
* [Podの停止](/docs/concepts/workloads/pods/pod/#termination-of-pods) | ||||||
* [Podのライフサイクル](/docs/concepts/workloads/pods/pod-lifecycle/) | ||||||
{{% /capture %}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.