unify init container
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: Initコンテナ(Init Containers)
|
title: Initコンテナ
|
||||||
content_template: templates/concept
|
content_template: templates/concept
|
||||||
weight: 40
|
weight: 40
|
||||||
---
|
---
|
||||||
@@ -36,7 +36,7 @@ Initコンテナは、リソースリミット、ボリューム、セキュリ
|
|||||||
|
|
||||||
## Initコンテナを使用する {#using-init-containers}
|
## Initコンテナを使用する {#using-init-containers}
|
||||||
|
|
||||||
Initコンテナはアプリケーションコンテナのイメージとは分離されているため、コンテナの起動に関連したコードにおいていくつかの利点があります。
|
Initコンテナはアプリケーションコンテナのイメージとは分離されているため、コンテナの起動に関連したコードにおいていくつかの利点があります。
|
||||||
|
|
||||||
* Initコンテナはアプリケーションのイメージに存在しないセットアップ用のユーティリティーやカスタムコードを含むことができます。例えば、セットアップ中に`sed`、`awk`、`python`や、`dig`のようなツールを使うためだけに、別のイメージを元にしてアプリケーションイメージを作る必要がなくなります。
|
* Initコンテナはアプリケーションのイメージに存在しないセットアップ用のユーティリティーやカスタムコードを含むことができます。例えば、セットアップ中に`sed`、`awk`、`python`や、`dig`のようなツールを使うためだけに、別のイメージを元にしてアプリケーションイメージを作る必要がなくなります。
|
||||||
* アプリケーションイメージをビルドする役割とデプロイする役割は、共同で単一のアプリケーションイメージをビルドする必要がないため、それぞれ独立して実施することができます。
|
* アプリケーションイメージをビルドする役割とデプロイする役割は、共同で単一のアプリケーションイメージをビルドする必要がないため、それぞれ独立して実施することができます。
|
||||||
@@ -250,6 +250,6 @@ Podレベルのコントロールグループ(cgroups)は、スケジュー
|
|||||||
{{% capture whatsnext %}}
|
{{% capture whatsnext %}}
|
||||||
|
|
||||||
* [Initコンテナを含むPodの作成](/docs/tasks/configure-pod-container/configure-pod-initialization/#creating-a-pod-that-has-an-init-container)方法について学ぶ。
|
* [Initコンテナを含むPodの作成](/docs/tasks/configure-pod-container/configure-pod-initialization/#creating-a-pod-that-has-an-init-container)方法について学ぶ。
|
||||||
* [Init Containerのデバッグ](/ja/docs/tasks/debug-application-cluster/debug-init-containers/)を行う方法について学ぶ。
|
* [Initコンテナのデバッグ](/ja/docs/tasks/debug-application-cluster/debug-init-containers/)を行う方法について学ぶ。
|
||||||
|
|
||||||
{{% /capture %}}
|
{{% /capture %}}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ PodCondition配列の各要素には、次の6つのフィールドがありま
|
|||||||
|
|
||||||
* `PodScheduled`: PodがNodeにスケジュールされました。
|
* `PodScheduled`: PodがNodeにスケジュールされました。
|
||||||
* `Ready`: Podはリクエストを処理でき、一致するすべてのサービスの負荷分散プールに追加されます。
|
* `Ready`: Podはリクエストを処理でき、一致するすべてのサービスの負荷分散プールに追加されます。
|
||||||
* `Initialized`: すべての[init containers](/docs/concepts/workloads/pods/init-containers)が正常に実行されました。
|
* `Initialized`: すべての[initコンテナ](/docs/concepts/workloads/pods/init-containers)が正常に実行されました。
|
||||||
* `ContainersReady`: Pod内のすべてのコンテナが準備できた状態です。
|
* `ContainersReady`: Pod内のすべてのコンテナが準備できた状態です。
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
title: Init Containerのデバッグ
|
title: Initコンテナのデバッグ
|
||||||
content_template: templates/task
|
content_template: templates/task
|
||||||
---
|
---
|
||||||
|
|
||||||
{{% capture overview %}}
|
{{% capture overview %}}
|
||||||
|
|
||||||
このページでは、Init Containerの実行に関連する問題を調査する方法を説明します。以下のコマンドラインの例では、Podを`<pod-name>`、Init Containerを`<init-container-1>`および`<init-container-2>`として参照しています。
|
このページでは、Initコンテナの実行に関連する問題を調査する方法を説明します。以下のコマンドラインの例では、Podを`<pod-name>`、Initコンテナを`<init-container-1>`および`<init-container-2>`として参照しています。
|
||||||
|
|
||||||
{{% /capture %}}
|
{{% /capture %}}
|
||||||
|
|
||||||
@@ -13,14 +13,14 @@ content_template: templates/task
|
|||||||
|
|
||||||
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
||||||
|
|
||||||
* [Init Container](/docs/concepts/abstractions/init-containers/)の基本を理解しておきましょう。
|
* [Initコンテナ](/ja/docs/concepts/abstractions/init-containers/)の基本を理解しておきましょう。
|
||||||
* [Init Containerを設定](/docs/tasks/configure-pod-container/configure-pod-initialization/#creating-a-pod-that-has-an-init-container/)しておきましょう。
|
* [Initコンテナを設定](/docs/tasks/configure-pod-container/configure-pod-initialization/#creating-a-pod-that-has-an-init-container/)しておきましょう。
|
||||||
|
|
||||||
{{% /capture %}}
|
{{% /capture %}}
|
||||||
|
|
||||||
{{% capture steps %}}
|
{{% capture steps %}}
|
||||||
|
|
||||||
## Init Containerのステータスを確認する
|
## Initコンテナのステータスを確認する
|
||||||
|
|
||||||
Podのステータスを表示します:
|
Podのステータスを表示します:
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ Podのステータスを表示します:
|
|||||||
kubectl get pod <pod-name>
|
kubectl get pod <pod-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
たとえば、`Init:1/2`というステータスは、2つのInit Containerのうちの1つが正常に完了したことを示します。
|
たとえば、`Init:1/2`というステータスは、2つのInitコンテナのうちの1つが正常に完了したことを示します。
|
||||||
|
|
||||||
```
|
```
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
@@ -37,15 +37,15 @@ NAME READY STATUS RESTARTS AGE
|
|||||||
|
|
||||||
ステータス値とその意味の例については、[Podのステータスを理解する](#understanding-pod-status)を参照してください。
|
ステータス値とその意味の例については、[Podのステータスを理解する](#understanding-pod-status)を参照してください。
|
||||||
|
|
||||||
## Init Containerの詳細を取得する
|
## Initコンテナの詳細を取得する
|
||||||
|
|
||||||
Init Containerの実行に関する詳細情報を表示します:
|
Initコンテナの実行に関する詳細情報を表示します:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl describe pod <pod-name>
|
kubectl describe pod <pod-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
たとえば、2つのInit Containerを持つPodでは、次のように表示されます:
|
たとえば、2つのInitコンテナを持つPodでは、次のように表示されます:
|
||||||
|
|
||||||
```
|
```
|
||||||
Init Containers:
|
Init Containers:
|
||||||
@@ -75,7 +75,7 @@ Init Containers:
|
|||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
また、Pod Specの`status.initContainerStatuses`フィールドを読むことでプログラムでInit Containerのステータスにアクセスすることもできます。:
|
また、Pod Specの`status.initContainerStatuses`フィールドを読むことでプログラムでInitコンテナのステータスにアクセスすることもできます。:
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -85,15 +85,15 @@ kubectl get pod nginx --template '{{.status.initContainerStatuses}}'
|
|||||||
|
|
||||||
このコマンドは生のJSONで上記と同じ情報を返します。
|
このコマンドは生のJSONで上記と同じ情報を返します。
|
||||||
|
|
||||||
## Init Containerのログにアクセスする
|
## Initコンテナのログにアクセスする
|
||||||
|
|
||||||
ログにアクセスするには、Init Container名とPod名を渡します。
|
ログにアクセスするには、Initコンテナ名とPod名を渡します。
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl logs <pod-name> -c <init-container-2>
|
kubectl logs <pod-name> -c <init-container-2>
|
||||||
```
|
```
|
||||||
|
|
||||||
シェルスクリプトを実行するInit Containerは、実行時にコマンドを出力します。たとえば、スクリプトの始めに`set -x`を実行することでBashで同じことができます。
|
シェルスクリプトを実行するInitコンテナは、実行時にコマンドを出力します。たとえば、スクリプトの始めに`set -x`を実行することでBashで同じことができます。
|
||||||
|
|
||||||
{{% /capture %}}
|
{{% /capture %}}
|
||||||
|
|
||||||
@@ -101,15 +101,15 @@ kubectl logs <pod-name> -c <init-container-2>
|
|||||||
|
|
||||||
## Podのステータスを理解する
|
## Podのステータスを理解する
|
||||||
|
|
||||||
`Init:`で始まるPodステータスはInit Containerの実行ステータスを要約します。以下の表は、Init Containerのデバッグ中に表示される可能性のあるステータス値の例をいくつか示しています。
|
`Init:`で始まるPodステータスはInitコンテナの実行ステータスを要約します。以下の表は、Initコンテナのデバッグ中に表示される可能性のあるステータス値の例をいくつか示しています。
|
||||||
|
|
||||||
ステータス | 意味
|
ステータス | 意味
|
||||||
------ | -------
|
------ | -------
|
||||||
`Init:N/M` | Podは`M`個のInit Containerを持ち、これまでに`N`個完了しました。
|
`Init:N/M` | Podは`M`個のInitコンテナを持ち、これまでに`N`個完了しました。
|
||||||
`Init:Error` | Init Containerが実行に失敗しました。
|
`Init:Error` | Initコンテナが実行に失敗しました。
|
||||||
`Init:CrashLoopBackOff` | Init Containerが繰り返し失敗しました。
|
`Init:CrashLoopBackOff` | Initコンテナが繰り返し失敗しました。
|
||||||
`Pending` | PodはまだInit Containerの実行を開始していません。
|
`Pending` | PodはまだInitコンテナの実行を開始していません。
|
||||||
`PodInitializing` or `Running` | PodはすでにInit Containerの実行を終了しています。
|
`PodInitializing` or `Running` | PodはすでにInitコンテナの実行を終了しています。
|
||||||
|
|
||||||
{{% /capture %}}
|
{{% /capture %}}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Podが長期間`Unknown`または`Terminating`の状態になっていること
|
|||||||
|
|
||||||
{{% capture whatsnext %}}
|
{{% capture whatsnext %}}
|
||||||
|
|
||||||
[Init Containerのデバッグ](/ja/docs/tasks/debug-application-cluster/debug-init-containers/)の詳細
|
[Initコンテナのデバッグ](/ja/docs/tasks/debug-application-cluster/debug-init-containers/)の詳細
|
||||||
|
|
||||||
{{% /capture %}}
|
{{% /capture %}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user