Skip to content

Commit 9bd9d44

Browse files
committed
Translate tasks/administer-cluster/declare-network-policy.md into Japanese.
1 parent e627a41 commit 9bd9d44

File tree

1 file changed

+25
-31
lines changed

1 file changed

+25
-31
lines changed
Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
---
2-
reviewers:
3-
- caseydavenport
4-
- danwinship
5-
title: Declare Network Policy
2+
title: ネットワークポリシーを宣言する
63
min-kubernetes-server-version: v1.8
74
content_type: task
85
---
9-
<!-- overview -->
10-
This document helps you get started using the Kubernetes [NetworkPolicy API](/docs/concepts/services-networking/network-policies/) to declare network policies that govern how pods communicate with each other.
116

7+
<!-- overview -->
8+
このドキュメントでは、Pod同士の通信を制御するネットワークポリシーを定義するための、Kubernetesの[NetworkPolicy API](/docs/concepts/services-networking/network-policies/)を使い始める手助けをします。
129

1310
## {{% heading "prerequisites" %}}
1411

15-
1612
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
1713

18-
Make sure you've configured a network provider with network policy support. There are a number of network providers that support NetworkPolicy, including:
14+
ネットワークポリシーをサポートしているネットワークプロバイダーが設定済みであることを確認してください。さまざまなネットワークプロバイダーがNetworkPolicyをサポートしています。次に挙げるのは一例です。
1915

2016
* [Calico](/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy/)
2117
* [Cilium](/docs/tasks/administer-cluster/network-policy-provider/cilium-network-policy/)
@@ -24,15 +20,15 @@ Make sure you've configured a network provider with network policy support. Ther
2420
* [Weave Net](/docs/tasks/administer-cluster/network-policy-provider/weave-network-policy/)
2521

2622
{{< note >}}
27-
The above list is sorted alphabetically by product name, not by recommendation or preference. This example is valid for a Kubernetes cluster using any of these providers.
23+
上記のリストは製品名のアルファベット順にソートされていて、推奨順や好ましい順にソートされているわけではありません。このページの例は、Kubernetesクラスターでこれらのどのプロバイダーを使用していても有効です。
2824
{{< /note >}}
2925

3026

3127
<!-- steps -->
3228

33-
## Create an `nginx` deployment and expose it via a service
29+
## `nginx` Deploymentを作成してService経由で公開する
3430

35-
To see how Kubernetes network policy works, start off by creating an `nginx` Deployment.
31+
Kubernetesのネットワークポリシーの仕組みを理解するために、まずは`nginx` Deploymentを作成することから始めましょう。
3632

3733
```console
3834
kubectl create deployment nginx --image=nginx
@@ -41,7 +37,7 @@ kubectl create deployment nginx --image=nginx
4137
deployment.apps/nginx created
4238
```
4339

44-
Expose the Deployment through a Service called `nginx`.
40+
`nginx`という名前のService経由でDeploymentを公開します。
4541

4642
```console
4743
kubectl expose deployment nginx --port=80
@@ -51,7 +47,7 @@ kubectl expose deployment nginx --port=80
5147
service/nginx exposed
5248
```
5349

54-
The above commands create a Deployment with an nginx Pod and expose the Deployment through a Service named `nginx`. The `nginx` Pod and Deployment are found in the `default` namespace.
50+
上記のコマンドを実行すると、nginx Podを持つDeploymentが作成され、そのDeploymentが`nginx`という名前のService経由で公開されます。`nginx`のPodおよびDeploymentは`default`名前空間の中にあります。
5551

5652
```console
5753
kubectl get svc,pod
@@ -66,15 +62,15 @@ NAME READY STATUS RESTARTS AGE
6662
pod/nginx-701339712-e0qfq 1/1 Running 0 35s
6763
```
6864

69-
## Test the service by accessing it from another Pod
65+
## もう1つのPodからアクセスしてServiceを検証する
7066

71-
You should be able to access the new `nginx` service from other Pods. To access the `nginx` Service from another Pod in the `default` namespace, start a busybox container:
67+
これで、新しい`nginx`サービスに他のPodからアクセスできるようになったはずです。`default`名前空間内の他のPodから`nginx` Serviceにアクセスするために、busyboxコンテナを起動します。
7268

7369
```console
7470
kubectl run busybox --rm -ti --image=busybox -- /bin/sh
7571
```
7672

77-
In your shell, run the following command:
73+
シェルの中で、次のコマンドを実行します。
7874

7975
```shell
8076
wget --spider --timeout=1 nginx
@@ -85,22 +81,21 @@ Connecting to nginx (10.100.0.16:80)
8581
remote file exists
8682
```
8783

88-
## Limit access to the `nginx` service
84+
## `nginx` Serviceへのアクセスを制限する
8985

90-
To limit the access to the `nginx` service so that only Pods with the label `access: true` can query it, create a NetworkPolicy object as follows:
86+
`nginx` Serviceへのアクセスを制限するために、`access: true`というラベルが付いたPodだけがクエリできるようにします。次の内容でNetworkPolicyオブジェクトを作成してください。
9187

9288
{{< codenew file="service/networking/nginx-policy.yaml" >}}
9389

94-
The name of a NetworkPolicy object must be a valid
95-
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
90+
NetworkPolicyオブジェクトの名前は、有効な[DNSサブドメイン名](/ja/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)でなければなりません。
9691

9792
{{< note >}}
98-
NetworkPolicy includes a `podSelector` which selects the grouping of Pods to which the policy applies. You can see this policy selects Pods with the label `app=nginx`. The label was automatically added to the Pod in the `nginx` Deployment. An empty `podSelector` selects all pods in the namespace.
93+
このNetworkPolicyには、ポリシーを適用するPodのグループを選択するための`podSelector`が含まれています。このポリシーは、ラベル`app=nginx`の付いたPodを選択していることがわかります。このラベルは、`nginx` Deployment内のPodに自動的に追加されたものです。空の`podSelector`は、その名前空間内のすべてのPodを選択します。
9994
{{< /note >}}
10095

101-
## Assign the policy to the service
96+
## Serviceにポリシーを割り当てる
10297

103-
Use kubectl to create a NetworkPolicy from the above `nginx-policy.yaml` file:
98+
kubectlを使って、上記の`nginx-policy.yaml`ファイルからNetworkPolicyを作成します。
10499

105100
```console
106101
kubectl apply -f https://k8s.io/examples/service/networking/nginx-policy.yaml
@@ -110,14 +105,15 @@ kubectl apply -f https://k8s.io/examples/service/networking/nginx-policy.yaml
110105
networkpolicy.networking.k8s.io/access-nginx created
111106
```
112107

113-
## Test access to the service when access label is not defined
114-
When you attempt to access the `nginx` Service from a Pod without the correct labels, the request times out:
108+
## accessラベルが定義されていない状態でServiceへのアクセスをテストする
109+
110+
`nginx` Serviceに正しいラベルが付いていないPodからアクセスを試してみると、リクエストがタイムアウトします。
115111

116112
```console
117113
kubectl run busybox --rm -ti --image=busybox -- /bin/sh
118114
```
119115

120-
In your shell, run the command:
116+
シェルの中で、次のコマンドを実行します。
121117

122118
```shell
123119
wget --spider --timeout=1 nginx
@@ -128,15 +124,15 @@ Connecting to nginx (10.100.0.16:80)
128124
wget: download timed out
129125
```
130126

131-
## Define access label and test again
127+
## accessラベルを定義して再テストする
132128

133-
You can create a Pod with the correct labels to see that the request is allowed:
129+
正しいラベルが付いたPodを作成すると、リクエストが許可されるようになるのがわかります。
134130

135131
```console
136132
kubectl run busybox --rm -ti --labels="access=true" --image=busybox -- /bin/sh
137133
```
138134

139-
In your shell, run the command:
135+
シェルの中で、次のコマンドを実行します。
140136

141137
```shell
142138
wget --spider --timeout=1 nginx
@@ -146,5 +142,3 @@ wget --spider --timeout=1 nginx
146142
Connecting to nginx (10.100.0.16:80)
147143
remote file exists
148144
```
149-
150-

0 commit comments

Comments
 (0)