From 475f1172d136143e946a54529223d6d2f8148ac2 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Thu, 17 Sep 2020 11:16:33 +0900 Subject: [PATCH 1/4] Copy concepts/workloads/pods/ephemeral-containers/ from en/ directory. --- .../workloads/pods/ephemeral-containers.md | 195 ++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 content/ja/docs/concepts/workloads/pods/ephemeral-containers.md diff --git a/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md b/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md new file mode 100644 index 0000000000..c1852df707 --- /dev/null +++ b/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md @@ -0,0 +1,195 @@ +--- +reviewers: +- verb +- yujuhong +title: Ephemeral Containers +content_type: concept +weight: 80 +--- + + + +{{< feature-state state="alpha" for_k8s_version="v1.16" >}} + +This page provides an overview of ephemeral containers: a special type of container +that runs temporarily in an existing {{< glossary_tooltip term_id="pod" >}} to +accomplish user-initiated actions such as troubleshooting. You use ephemeral +containers to inspect services rather than to build applications. + +{{< warning >}} +Ephemeral containers are in early alpha state and are not suitable for production +clusters. In accordance with the [Kubernetes Deprecation Policy]( +/docs/reference/using-api/deprecation-policy/), this alpha feature could change +significantly in the future or be removed entirely. +{{< /warning >}} + + + + + +## Understanding ephemeral containers + +{{< glossary_tooltip text="Pods" term_id="pod" >}} are the fundamental building +block of Kubernetes applications. Since Pods are intended to be disposable and +replaceable, you cannot add a container to a Pod once it has been created. +Instead, you usually delete and replace Pods in a controlled fashion using +{{< glossary_tooltip text="deployments" term_id="deployment" >}}. + +Sometimes it's necessary to inspect the state of an existing Pod, however, for +example to troubleshoot a hard-to-reproduce bug. In these cases you can run +an ephemeral container in an existing Pod to inspect its state and run +arbitrary commands. + +### What is an ephemeral container? + +Ephemeral containers differ from other containers in that they lack guarantees +for resources or execution, and they will never be automatically restarted, so +they are not appropriate for building applications. Ephemeral containers are +described using the same `ContainerSpec` as regular containers, but many fields +are incompatible and disallowed for ephemeral containers. + +- Ephemeral containers may not have ports, so fields such as `ports`, + `livenessProbe`, `readinessProbe` are disallowed. +- Pod resource allocations are immutable, so setting `resources` is disallowed. +- For a complete list of allowed fields, see the [EphemeralContainer reference + documentation](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ephemeralcontainer-v1-core). + +Ephemeral containers are created using a special `ephemeralcontainers` handler +in the API rather than by adding them directly to `pod.spec`, so it's not +possible to add an ephemeral container using `kubectl edit`. + +Like regular containers, you may not change or remove an ephemeral container +after you have added it to a Pod. + +## Uses for ephemeral containers + +Ephemeral containers are useful for interactive troubleshooting when `kubectl +exec` is insufficient because a container has crashed or a container image +doesn't include debugging utilities. + +In particular, [distroless images](https://github.com/GoogleContainerTools/distroless) +enable you to deploy minimal container images that reduce attack surface +and exposure to bugs and vulnerabilities. Since distroless images do not include a +shell or any debugging utilities, it's difficult to troubleshoot distroless +images using `kubectl exec` alone. + +When using ephemeral containers, it's helpful to enable [process namespace +sharing](/docs/tasks/configure-pod-container/share-process-namespace/) so +you can view processes in other containers. + +See [Debugging with Ephemeral Debug Container]( +/docs/tasks/debug-application-cluster/debug-running-pod/#debugging-with-ephemeral-debug-container) +for examples of troubleshooting using ephemeral containers. + +## Ephemeral containers API + +{{< note >}} +The examples in this section require the `EphemeralContainers` [feature +gate](/docs/reference/command-line-tools-reference/feature-gates/) to be +enabled, and Kubernetes client and server version v1.16 or later. +{{< /note >}} + +The examples in this section demonstrate how ephemeral containers appear in +the API. You would normally use `kubectl alpha debug` or another `kubectl` +[plugin](/docs/tasks/extend-kubectl/kubectl-plugins/) to automate these steps +rather than invoking the API directly. + +Ephemeral containers are created using the `ephemeralcontainers` subresource +of Pod, which can be demonstrated using `kubectl --raw`. First describe +the ephemeral container to add as an `EphemeralContainers` list: + +```json +{ + "apiVersion": "v1", + "kind": "EphemeralContainers", + "metadata": { + "name": "example-pod" + }, + "ephemeralContainers": [{ + "command": [ + "sh" + ], + "image": "busybox", + "imagePullPolicy": "IfNotPresent", + "name": "debugger", + "stdin": true, + "tty": true, + "terminationMessagePolicy": "File" + }] +} +``` + +To update the ephemeral containers of the already running `example-pod`: + +```shell +kubectl replace --raw /api/v1/namespaces/default/pods/example-pod/ephemeralcontainers -f ec.json +``` + +This will return the new list of ephemeral containers: + +```json +{ + "kind":"EphemeralContainers", + "apiVersion":"v1", + "metadata":{ + "name":"example-pod", + "namespace":"default", + "selfLink":"/api/v1/namespaces/default/pods/example-pod/ephemeralcontainers", + "uid":"a14a6d9b-62f2-4119-9d8e-e2ed6bc3a47c", + "resourceVersion":"15886", + "creationTimestamp":"2019-08-29T06:41:42Z" + }, + "ephemeralContainers":[ + { + "name":"debugger", + "image":"busybox", + "command":[ + "sh" + ], + "resources":{ + + }, + "terminationMessagePolicy":"File", + "imagePullPolicy":"IfNotPresent", + "stdin":true, + "tty":true + } + ] +} +``` + +You can view the state of the newly created ephemeral container using `kubectl describe`: + +```shell +kubectl describe pod example-pod +``` + +``` +... +Ephemeral Containers: + debugger: + Container ID: docker://cf81908f149e7e9213d3c3644eda55c72efaff67652a2685c1146f0ce151e80f + Image: busybox + Image ID: docker-pullable://busybox@sha256:9f1003c480699be56815db0f8146ad2e22efea85129b5b5983d0e0fb52d9ab70 + Port: + Host Port: + Command: + sh + State: Running + Started: Thu, 29 Aug 2019 06:42:21 +0000 + Ready: False + Restart Count: 0 + Environment: + Mounts: +... +``` + +You can interact with the new ephemeral container in the same way as other +containers using `kubectl attach`, `kubectl exec`, and `kubectl logs`, for +example: + +```shell +kubectl attach -it example-pod -c debugger +``` + + From d6e6a47baefd379f3f4a787721a59999334a6c6b Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Thu, 17 Sep 2020 11:16:52 +0900 Subject: [PATCH 2/4] Translate concepts/workloads/pods/ephemeral-containers into japanese. --- .../workloads/pods/ephemeral-containers.md | 100 +++++------------- 1 file changed, 26 insertions(+), 74 deletions(-) diff --git a/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md b/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md index c1852df707..4d5ea9518e 100644 --- a/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md +++ b/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md @@ -1,8 +1,5 @@ --- -reviewers: -- verb -- yujuhong -title: Ephemeral Containers +title: ephemeralコンテナ content_type: concept weight: 80 --- @@ -11,92 +8,51 @@ weight: 80 {{< feature-state state="alpha" for_k8s_version="v1.16" >}} -This page provides an overview of ephemeral containers: a special type of container -that runs temporarily in an existing {{< glossary_tooltip term_id="pod" >}} to -accomplish user-initiated actions such as troubleshooting. You use ephemeral -containers to inspect services rather than to build applications. +このページでは、特別な種類のコンテナであるephemeralコンテナの概要を説明します。ephemeralコンテナは、トラブルシューティングなどのユーザーが開始するアクションを実行するために、すでに存在する{{< glossary_tooltip term_id="pod" >}}内で一時的に実行するコンテナです。ephemeralコンテナは、アプリケーションの構築ではなく、serviceの調査のために利用します。 {{< warning >}} -Ephemeral containers are in early alpha state and are not suitable for production -clusters. In accordance with the [Kubernetes Deprecation Policy]( -/docs/reference/using-api/deprecation-policy/), this alpha feature could change -significantly in the future or be removed entirely. +ephemeralコンテナは初期のアルファ状態であり、本番クラスタには適しません。[Kubernetesの非推奨ポリシー](/docs/reference/using-api/deprecation-policy/)に従って、このアルファ機能は、将来大きく変更されたり、完全に削除される可能性があります。 {{< /warning >}} - - -## Understanding ephemeral containers +## ephemeralコンテナを理解する -{{< glossary_tooltip text="Pods" term_id="pod" >}} are the fundamental building -block of Kubernetes applications. Since Pods are intended to be disposable and -replaceable, you cannot add a container to a Pod once it has been created. -Instead, you usually delete and replace Pods in a controlled fashion using -{{< glossary_tooltip text="deployments" term_id="deployment" >}}. +{{< glossary_tooltip text="Pod" term_id="pod" >}}は、Kubernetesのアプリケーションの基本的なビルディングブロックです。Podは破棄可能かつ置き換え可能であることが想定されているため、一度Podが作成されると新しいコンテナを追加することはできません。その代わりに、通常は{{< glossary_tooltip text="Deployment" term_id="deployment" >}}を使用した制御されたやり方でPodを削除して置き換えます。 -Sometimes it's necessary to inspect the state of an existing Pod, however, for -example to troubleshoot a hard-to-reproduce bug. In these cases you can run -an ephemeral container in an existing Pod to inspect its state and run -arbitrary commands. +たとえば、再現困難なバグのトラブルシューティングなどのために、すでに存在するPodの状態を調査する必要が出てくることがあります。このような場合、既存のPod内でephemeralコンテナを実行することで、Podの状態を調査したり、任意のコマンドを実行したりできます。 -### What is an ephemeral container? +### ephemeralコンテナとは何か? -Ephemeral containers differ from other containers in that they lack guarantees -for resources or execution, and they will never be automatically restarted, so -they are not appropriate for building applications. Ephemeral containers are -described using the same `ContainerSpec` as regular containers, but many fields -are incompatible and disallowed for ephemeral containers. +ephemeralコンテナは、他のコンテナと異なり、リソースや実行が保証されず、自動的に再起動されることも決してないため、アプリケーションを構築する目的には適しません。ephemeralコンテナは、普通のコンテナと同じ`ContainerSpec`で記述されますが、多くのフィールドに互換性がなかったり、使用できなくなっています。 -- Ephemeral containers may not have ports, so fields such as `ports`, - `livenessProbe`, `readinessProbe` are disallowed. -- Pod resource allocations are immutable, so setting `resources` is disallowed. -- For a complete list of allowed fields, see the [EphemeralContainer reference - documentation](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ephemeralcontainer-v1-core). +- ephemeralコンテナはポートを持つことができないため、`ports`、`livenessProbe`、`readinessProbe`などの使用が禁止されています。 +- Podリソースの割り当てはイミュータブルであるため、`resources`の設定が禁止されています。 +- 利用が許可されているフィールドの一覧については、[EphemeralContainerのリファレンスドキュメント](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ephemeralcontainer-v1-core)を参照してください。 -Ephemeral containers are created using a special `ephemeralcontainers` handler -in the API rather than by adding them directly to `pod.spec`, so it's not -possible to add an ephemeral container using `kubectl edit`. +ephemeralコンテナは、直接`pod.spec`に追加するのではなく、API内の特別な`ephemeralcontainers`ハンドラを使用して作成します。そのため、ephemeralコンテナを`kubectl edit`を使用して追加することはできません。 -Like regular containers, you may not change or remove an ephemeral container -after you have added it to a Pod. +ephemeralコンテナをPodに追加した後は、通常のコンテナのようにephemeralコンテナを変更または削除することはできません。 -## Uses for ephemeral containers +## ephemeralコンテナの用途 -Ephemeral containers are useful for interactive troubleshooting when `kubectl -exec` is insufficient because a container has crashed or a container image -doesn't include debugging utilities. +ephemeralコンテナは、コンテナがクラッシュしてしまったり、コンテナイメージにデバッグ用ユーティリティが同梱されていない場合など、`kubectl exec`では不十分なときにインタラクティブなトラブルシューティングを行うために役立ちます。 -In particular, [distroless images](https://github.com/GoogleContainerTools/distroless) -enable you to deploy minimal container images that reduce attack surface -and exposure to bugs and vulnerabilities. Since distroless images do not include a -shell or any debugging utilities, it's difficult to troubleshoot distroless -images using `kubectl exec` alone. +特に、[distrolessイメージ](https://github.com/GoogleContainerTools/distroless)を利用すると、攻撃対象領域を減らし、バグや脆弱性を露出する可能性を減らせる最小のコンテナイメージをデプロイできるようになります。distrolessイメージにはシェルもデバッグ用のユーティリティも含まれないため、`kubectl exec`のみを使用してdistrolessイメージのトラブルシューティングを行うのは困難です。 -When using ephemeral containers, it's helpful to enable [process namespace -sharing](/docs/tasks/configure-pod-container/share-process-namespace/) so -you can view processes in other containers. +ephemeralコンテナを利用する場合には、他のコンテナ内のプロセスにアクセスできるように、[プロセス名前空間の共有](/ja/docs/tasks/configure-pod-container/share-process-namespace/)を有効にすると便利です。 -See [Debugging with Ephemeral Debug Container]( -/docs/tasks/debug-application-cluster/debug-running-pod/#debugging-with-ephemeral-debug-container) -for examples of troubleshooting using ephemeral containers. +ephemeralコンテナを利用してトラブルシューティングを行う例については、[デバッグ用のephemeralコンテナを使用してデバッグする](/docs/tasks/debug-application-cluster/debug-running-pod/#debugging-with-ephemeral-debug-container)を参照してください。 ## Ephemeral containers API {{< note >}} -The examples in this section require the `EphemeralContainers` [feature -gate](/docs/reference/command-line-tools-reference/feature-gates/) to be -enabled, and Kubernetes client and server version v1.16 or later. +このセクションの例を実行するには、`EphemeralContainers`[フィーチャーゲート](/ja/docs/reference/command-line-tools-reference/feature-gates/)を有効にして、Kubernetesクライアントとサーバーのバージョンをv1.16以上にする必要があります。 {{< /note >}} -The examples in this section demonstrate how ephemeral containers appear in -the API. You would normally use `kubectl alpha debug` or another `kubectl` -[plugin](/docs/tasks/extend-kubectl/kubectl-plugins/) to automate these steps -rather than invoking the API directly. +このセクションの例では、API内でephemeralコンテナを表示する方法を示します。通常は、APIを直接呼び出すのではなく、`kubectl alpha debug`やその他の`kubectl`[プラグイン](/docs/tasks/extend-kubectl/kubectl-plugins/)を使用して、これらのステップを自動化します。 -Ephemeral containers are created using the `ephemeralcontainers` subresource -of Pod, which can be demonstrated using `kubectl --raw`. First describe -the ephemeral container to add as an `EphemeralContainers` list: +ephemeralコンテナは、Podの`ephemeralcontainers`サブリソースを使用して作成されます。このサブリソースは、`kubectl --raw`を使用して確認できます。まずはじめに、以下に`EphemeralContainers`リストとして追加するためのephemeralコンテナを示します。 ```json { @@ -119,13 +75,13 @@ the ephemeral container to add as an `EphemeralContainers` list: } ``` -To update the ephemeral containers of the already running `example-pod`: +すでに実行中の`example-pod`のephemeralコンテナを更新するには、次のコマンドを実行します。 ```shell -kubectl replace --raw /api/v1/namespaces/default/pods/example-pod/ephemeralcontainers -f ec.json +kubectl replace --raw /api/v1/namespaces/default/pods/example-pod/ephemeralcontainers -f ec.json ``` -This will return the new list of ephemeral containers: +このコマンドを実行すると、新しいephemeralコンテナのリストが返されます。 ```json { @@ -158,7 +114,7 @@ This will return the new list of ephemeral containers: } ``` -You can view the state of the newly created ephemeral container using `kubectl describe`: +新しく作成されたephemeralコンテナの状態を確認するには、`kubectl describe`を使用します。 ```shell kubectl describe pod example-pod @@ -184,12 +140,8 @@ Ephemeral Containers: ... ``` -You can interact with the new ephemeral container in the same way as other -containers using `kubectl attach`, `kubectl exec`, and `kubectl logs`, for -example: +新しいephemeralコンテナとやりとりをするには、他のコンテナと同じように、`kubectl attach`、`kubectl exec`、`kubectl logs`などのコマンドが利用できます。例えば、次のようなコマンドが実行できます。 ```shell kubectl attach -it example-pod -c debugger ``` - - From c02a3cf9ec9f38017eb07d5eb5a925a5103a6ece Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sat, 19 Sep 2020 12:58:40 +0900 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: bells17 --- .../ja/docs/concepts/workloads/pods/ephemeral-containers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md b/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md index 4d5ea9518e..e7e5dfafdc 100644 --- a/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md +++ b/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md @@ -18,13 +18,13 @@ ephemeralコンテナは初期のアルファ状態であり、本番クラス ## ephemeralコンテナを理解する -{{< glossary_tooltip text="Pod" term_id="pod" >}}は、Kubernetesのアプリケーションの基本的なビルディングブロックです。Podは破棄可能かつ置き換え可能であることが想定されているため、一度Podが作成されると新しいコンテナを追加することはできません。その代わりに、通常は{{< glossary_tooltip text="Deployment" term_id="deployment" >}}を使用した制御されたやり方でPodを削除して置き換えます。 +{{< glossary_tooltip text="Pod" term_id="pod" >}}は、Kubernetesのアプリケーションの基本的なビルディングブロックです。Podは破棄可能かつ置き換え可能であることが想定されているため、一度Podが作成されると新しいコンテナを追加することはできません。その代わりに、通常は{{< glossary_tooltip text="Deployment" term_id="deployment" >}}を使用してPodを削除して置き換えます。 たとえば、再現困難なバグのトラブルシューティングなどのために、すでに存在するPodの状態を調査する必要が出てくることがあります。このような場合、既存のPod内でephemeralコンテナを実行することで、Podの状態を調査したり、任意のコマンドを実行したりできます。 ### ephemeralコンテナとは何か? -ephemeralコンテナは、他のコンテナと異なり、リソースや実行が保証されず、自動的に再起動されることも決してないため、アプリケーションを構築する目的には適しません。ephemeralコンテナは、普通のコンテナと同じ`ContainerSpec`で記述されますが、多くのフィールドに互換性がなかったり、使用できなくなっています。 +ephemeralコンテナは、他のコンテナと異なり、リソースや実行が保証されず、自動的に再起動されることも決してないため、アプリケーションを構築する目的には適しません。ephemeralコンテナは、通常のコンテナと同じ`ContainerSpec`で記述されますが、多くのフィールドに互換性がなかったり、使用できなくなっています。 - ephemeralコンテナはポートを持つことができないため、`ports`、`livenessProbe`、`readinessProbe`などの使用が禁止されています。 - Podリソースの割り当てはイミュータブルであるため、`resources`の設定が禁止されています。 From 1c7cf96b5ba31931d94624661bfcf2e9e4a67779 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sat, 19 Sep 2020 13:07:03 +0900 Subject: [PATCH 4/4] =?UTF-8?q?Replace=20"ephemeral"=20with=20"=E3=82=A8?= =?UTF-8?q?=E3=83=95=E3=82=A7=E3=83=A1=E3=83=A9=E3=83=AB".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workloads/pods/ephemeral-containers.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md b/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md index e7e5dfafdc..0fa45de94b 100644 --- a/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md +++ b/content/ja/docs/concepts/workloads/pods/ephemeral-containers.md @@ -1,5 +1,5 @@ --- -title: ephemeralコンテナ +title: エフェメラルコンテナ content_type: concept weight: 80 --- @@ -8,41 +8,41 @@ weight: 80 {{< feature-state state="alpha" for_k8s_version="v1.16" >}} -このページでは、特別な種類のコンテナであるephemeralコンテナの概要を説明します。ephemeralコンテナは、トラブルシューティングなどのユーザーが開始するアクションを実行するために、すでに存在する{{< glossary_tooltip term_id="pod" >}}内で一時的に実行するコンテナです。ephemeralコンテナは、アプリケーションの構築ではなく、serviceの調査のために利用します。 +このページでは、特別な種類のコンテナであるエフェメラルコンテナの概要を説明します。エフェメラルコンテナは、トラブルシューティングなどのユーザーが開始するアクションを実行するために、すでに存在する{{< glossary_tooltip term_id="pod" >}}内で一時的に実行するコンテナです。エフェメラルコンテナは、アプリケーションの構築ではなく、serviceの調査のために利用します。 {{< warning >}} -ephemeralコンテナは初期のアルファ状態であり、本番クラスタには適しません。[Kubernetesの非推奨ポリシー](/docs/reference/using-api/deprecation-policy/)に従って、このアルファ機能は、将来大きく変更されたり、完全に削除される可能性があります。 +エフェメラルコンテナは初期のアルファ状態であり、本番クラスタには適しません。[Kubernetesの非推奨ポリシー](/docs/reference/using-api/deprecation-policy/)に従って、このアルファ機能は、将来大きく変更されたり、完全に削除される可能性があります。 {{< /warning >}} -## ephemeralコンテナを理解する +## エフェメラルコンテナを理解する {{< glossary_tooltip text="Pod" term_id="pod" >}}は、Kubernetesのアプリケーションの基本的なビルディングブロックです。Podは破棄可能かつ置き換え可能であることが想定されているため、一度Podが作成されると新しいコンテナを追加することはできません。その代わりに、通常は{{< glossary_tooltip text="Deployment" term_id="deployment" >}}を使用してPodを削除して置き換えます。 -たとえば、再現困難なバグのトラブルシューティングなどのために、すでに存在するPodの状態を調査する必要が出てくることがあります。このような場合、既存のPod内でephemeralコンテナを実行することで、Podの状態を調査したり、任意のコマンドを実行したりできます。 +たとえば、再現困難なバグのトラブルシューティングなどのために、すでに存在するPodの状態を調査する必要が出てくることがあります。このような場合、既存のPod内でエフェメラルコンテナを実行することで、Podの状態を調査したり、任意のコマンドを実行したりできます。 -### ephemeralコンテナとは何か? +### エフェメラルコンテナとは何か? -ephemeralコンテナは、他のコンテナと異なり、リソースや実行が保証されず、自動的に再起動されることも決してないため、アプリケーションを構築する目的には適しません。ephemeralコンテナは、通常のコンテナと同じ`ContainerSpec`で記述されますが、多くのフィールドに互換性がなかったり、使用できなくなっています。 +エフェメラルコンテナは、他のコンテナと異なり、リソースや実行が保証されず、自動的に再起動されることも決してないため、アプリケーションを構築する目的には適しません。エフェメラルコンテナは、通常のコンテナと同じ`ContainerSpec`で記述されますが、多くのフィールドに互換性がなかったり、使用できなくなっています。 -- ephemeralコンテナはポートを持つことができないため、`ports`、`livenessProbe`、`readinessProbe`などの使用が禁止されています。 +- エフェメラルコンテナはポートを持つことができないため、`ports`、`livenessProbe`、`readinessProbe`などは使えなくなっています。 - Podリソースの割り当てはイミュータブルであるため、`resources`の設定が禁止されています。 - 利用が許可されているフィールドの一覧については、[EphemeralContainerのリファレンスドキュメント](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ephemeralcontainer-v1-core)を参照してください。 -ephemeralコンテナは、直接`pod.spec`に追加するのではなく、API内の特別な`ephemeralcontainers`ハンドラを使用して作成します。そのため、ephemeralコンテナを`kubectl edit`を使用して追加することはできません。 +エフェメラルコンテナは、直接`pod.spec`に追加するのではなく、API内の特別な`ephemeralcontainers`ハンドラを使用して作成します。そのため、エフェメラルコンテナを`kubectl edit`を使用して追加することはできません。 -ephemeralコンテナをPodに追加した後は、通常のコンテナのようにephemeralコンテナを変更または削除することはできません。 +エフェメラルコンテナをPodに追加した後は、通常のコンテナのようにエフェメラルコンテナを変更または削除することはできません。 -## ephemeralコンテナの用途 +## エフェメラルコンテナの用途 -ephemeralコンテナは、コンテナがクラッシュしてしまったり、コンテナイメージにデバッグ用ユーティリティが同梱されていない場合など、`kubectl exec`では不十分なときにインタラクティブなトラブルシューティングを行うために役立ちます。 +エフェメラルコンテナは、コンテナがクラッシュしてしまったり、コンテナイメージにデバッグ用ユーティリティが同梱されていない場合など、`kubectl exec`では不十分なときにインタラクティブなトラブルシューティングを行うために役立ちます。 特に、[distrolessイメージ](https://github.com/GoogleContainerTools/distroless)を利用すると、攻撃対象領域を減らし、バグや脆弱性を露出する可能性を減らせる最小のコンテナイメージをデプロイできるようになります。distrolessイメージにはシェルもデバッグ用のユーティリティも含まれないため、`kubectl exec`のみを使用してdistrolessイメージのトラブルシューティングを行うのは困難です。 -ephemeralコンテナを利用する場合には、他のコンテナ内のプロセスにアクセスできるように、[プロセス名前空間の共有](/ja/docs/tasks/configure-pod-container/share-process-namespace/)を有効にすると便利です。 +エフェメラルコンテナを利用する場合には、他のコンテナ内のプロセスにアクセスできるように、[プロセス名前空間の共有](/ja/docs/tasks/configure-pod-container/share-process-namespace/)を有効にすると便利です。 -ephemeralコンテナを利用してトラブルシューティングを行う例については、[デバッグ用のephemeralコンテナを使用してデバッグする](/docs/tasks/debug-application-cluster/debug-running-pod/#debugging-with-ephemeral-debug-container)を参照してください。 +エフェメラルコンテナを利用してトラブルシューティングを行う例については、[デバッグ用のエフェメラルコンテナを使用してデバッグする](/docs/tasks/debug-application-cluster/debug-running-pod/#debugging-with-ephemeral-debug-container)を参照してください。 ## Ephemeral containers API @@ -50,9 +50,9 @@ ephemeralコンテナを利用してトラブルシューティングを行う このセクションの例を実行するには、`EphemeralContainers`[フィーチャーゲート](/ja/docs/reference/command-line-tools-reference/feature-gates/)を有効にして、Kubernetesクライアントとサーバーのバージョンをv1.16以上にする必要があります。 {{< /note >}} -このセクションの例では、API内でephemeralコンテナを表示する方法を示します。通常は、APIを直接呼び出すのではなく、`kubectl alpha debug`やその他の`kubectl`[プラグイン](/docs/tasks/extend-kubectl/kubectl-plugins/)を使用して、これらのステップを自動化します。 +このセクションの例では、API内でエフェメラルコンテナを表示する方法を示します。通常は、APIを直接呼び出すのではなく、`kubectl alpha debug`やその他の`kubectl`[プラグイン](/docs/tasks/extend-kubectl/kubectl-plugins/)を使用して、これらのステップを自動化します。 -ephemeralコンテナは、Podの`ephemeralcontainers`サブリソースを使用して作成されます。このサブリソースは、`kubectl --raw`を使用して確認できます。まずはじめに、以下に`EphemeralContainers`リストとして追加するためのephemeralコンテナを示します。 +エフェメラルコンテナは、Podの`ephemeralcontainers`サブリソースを使用して作成されます。このサブリソースは、`kubectl --raw`を使用して確認できます。まずはじめに、以下に`EphemeralContainers`リストとして追加するためのエフェメラルコンテナを示します。 ```json { @@ -75,13 +75,13 @@ ephemeralコンテナは、Podの`ephemeralcontainers`サブリソースを使 } ``` -すでに実行中の`example-pod`のephemeralコンテナを更新するには、次のコマンドを実行します。 +すでに実行中の`example-pod`のエフェメラルコンテナを更新するには、次のコマンドを実行します。 ```shell kubectl replace --raw /api/v1/namespaces/default/pods/example-pod/ephemeralcontainers -f ec.json ``` -このコマンドを実行すると、新しいephemeralコンテナのリストが返されます。 +このコマンドを実行すると、新しいエフェメラルコンテナのリストが返されます。 ```json { @@ -114,7 +114,7 @@ kubectl replace --raw /api/v1/namespaces/default/pods/example-pod/ephemeralconta } ``` -新しく作成されたephemeralコンテナの状態を確認するには、`kubectl describe`を使用します。 +新しく作成されたエフェメラルコンテナの状態を確認するには、`kubectl describe`を使用します。 ```shell kubectl describe pod example-pod @@ -140,7 +140,7 @@ Ephemeral Containers: ... ``` -新しいephemeralコンテナとやりとりをするには、他のコンテナと同じように、`kubectl attach`、`kubectl exec`、`kubectl logs`などのコマンドが利用できます。例えば、次のようなコマンドが実行できます。 +新しいエフェメラルコンテナとやりとりをするには、他のコンテナと同じように、`kubectl attach`、`kubectl exec`、`kubectl logs`などのコマンドが利用できます。例えば、次のようなコマンドが実行できます。 ```shell kubectl attach -it example-pod -c debugger