Skip to content

Commit 47a1375

Browse files
committed
Translate concepts/configuration/organize-cluster-access-kubeconfig into Japanese
1 parent cb894d4 commit 47a1375

File tree

2 files changed

+52
-95
lines changed

2 files changed

+52
-95
lines changed

content/ja/docs/concepts/configuration/organize-cluster-access-kubeconfig.md

Lines changed: 51 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,112 @@
11
---
2-
title: Organizing Cluster Access Using kubeconfig Files
2+
title: kubeconfigファイルを使用してクラスターアクセスを組織する
33
content_type: concept
44
weight: 60
55
---
66

77
<!-- overview -->
88

9-
Use kubeconfig files to organize information about clusters, users, namespaces, and
10-
authentication mechanisms. The `kubectl` command-line tool uses kubeconfig files to
11-
find the information it needs to choose a cluster and communicate with the API server
12-
of a cluster.
9+
kubeconfigを使用すると、クラスターに、ユーザー、名前空間、認証の仕組みに関する情報を組織できます。`kubectl`コマンドラインツールはkubeconfigファイルを使用してクラスターを選択するために必要な情報を見つけ、クラスターのAPIサーバーと通信します。
1310

1411
{{< note >}}
15-
A file that is used to configure access to clusters is called
16-
a *kubeconfig file*. This is a generic way of referring to configuration files.
17-
It does not mean that there is a file named `kubeconfig`.
12+
クラスターへのアクセスを設定するために使われるファイルは*kubeconfigファイル*と呼ばれます。これは設定ファイルを指すために使われる一般的な方法です。`kubeconfig`という名前を持つファイルが存在するという意味ではありません。
1813
{{< /note >}}
1914

20-
By default, `kubectl` looks for a file named `config` in the `$HOME/.kube` directory.
21-
You can specify other kubeconfig files by setting the `KUBECONFIG` environment
22-
variable or by setting the
23-
[`--kubeconfig`](/docs/reference/generated/kubectl/kubectl/) flag.
24-
25-
For step-by-step instructions on creating and specifying kubeconfig files, see
26-
[Configure Access to Multiple Clusters](/docs/tasks/access-application-cluster/configure-access-multiple-clusters).
27-
28-
15+
デフォルトでは、`kubectl``$HOME/.kube`ディレクトリ内にある`config`という名前のファイルを探します。`KUBECONFIG`環境変数を設定するか、[`--kubeconfig`](/docs/reference/generated/kubectl/kubectl/)フラグで指定することで、別のkubeconfigファイルを指定することもできます。
2916

17+
kubeconfigファイルの作成と指定に関するステップバイステップの手順を知りたいときは、[複数のクラスターへのアクセスを設定する](/docs/tasks/access-application-cluster/configure-access-multiple-clusters)を参照してください。
3018

3119
<!-- body -->
3220

33-
## Supporting multiple clusters, users, and authentication mechanisms
21+
## 複数のクラスター、ユーザ、認証の仕組みのサポート
3422

35-
Suppose you have several clusters, and your users and components authenticate
36-
in a variety of ways. For example:
23+
複数のクラスターを持っていて、ユーザーやコンポーネントがさまざまな方法で認証を行う次のような状況を考えてみます。
3724

38-
- A running kubelet might authenticate using certificates.
39-
- A user might authenticate using tokens.
40-
- Administrators might have sets of certificates that they provide to individual users.
25+
- 実行中のkubeletが証明書を使用して認証を行う可能性がある。
26+
- ユーザーがトークンを使用して認証を行う可能性がある。
27+
- 管理者が個別のユーザに提供する複数の証明書を持っている可能性がある。
4128

42-
With kubeconfig files, you can organize your clusters, users, and namespaces.
43-
You can also define contexts to quickly and easily switch between
44-
clusters and namespaces.
29+
kubeconfigファイルを使用すると、クラスター、ユーザー、名前空間を組織化することができます。また、contextを定義することで、複数のクラスターや名前空間を素早く簡単に切り替えられます。
4530

4631
## Context
4732

48-
A *context* element in a kubeconfig file is used to group access parameters
49-
under a convenient name. Each context has three parameters: cluster, namespace, and user.
50-
By default, the `kubectl` command-line tool uses parameters from
51-
the *current context* to communicate with the cluster.
33+
kubeconfigファイルの*context*要素は、アクセスパラメーターを使いやすい名前でグループ化するために使われます。各contextは3つのパラメータ、cluster、namespace、userを持ちます。デフォルトでは、`kubectl`コマンドラインツールはクラスターとの通信に*current context*のパラメーターを使用します。
34+
35+
current contextを選択するには、以下のコマンドを使用します。
5236

53-
To choose the current context:
5437
```
5538
kubectl config use-context
5639
```
5740

58-
## The KUBECONFIG environment variable
41+
## KUBECONFIG環境変数
5942

60-
The `KUBECONFIG` environment variable holds a list of kubeconfig files.
61-
For Linux and Mac, the list is colon-delimited. For Windows, the list
62-
is semicolon-delimited. The `KUBECONFIG` environment variable is not
63-
required. If the `KUBECONFIG` environment variable doesn't exist,
64-
`kubectl` uses the default kubeconfig file, `$HOME/.kube/config`.
43+
`KUBECONFIG`環境変数には、kubeconfigファイルのリストを指定できます。LinuxとMacでは、リストはコロン区切りです。Windowsでは、セミコロン区切りです。`KUBECONFIG`環境変数は必須ではありません。`KUBECONFIG`環境変数が存在しない場合は、`kubectl`はデフォルトのkubeconfigファイルである`$HOME/.kube/config`を使用します。
6544

66-
If the `KUBECONFIG` environment variable does exist, `kubectl` uses
67-
an effective configuration that is the result of merging the files
68-
listed in the `KUBECONFIG` environment variable.
45+
`KUBECONFIG`環境変数が存在する場合は、`kubectl``KUBECONFIG`環境変数にリストされているファイルをマージした結果を有効な設定として使用します。
6946

70-
## Merging kubeconfig files
47+
## kubeconfigファイルのマージ
7148

72-
To see your configuration, enter this command:
49+
設定ファイルを確認するには、以下のコマンドを実行します。
7350

7451
```shell
7552
kubectl config view
7653
```
7754

78-
As described previously, the output might be from a single kubeconfig file,
79-
or it might be the result of merging several kubeconfig files.
80-
81-
Here are the rules that `kubectl` uses when it merges kubeconfig files:
82-
83-
1. If the `--kubeconfig` flag is set, use only the specified file. Do not merge.
84-
Only one instance of this flag is allowed.
85-
86-
Otherwise, if the `KUBECONFIG` environment variable is set, use it as a
87-
list of files that should be merged.
88-
Merge the files listed in the `KUBECONFIG` environment variable
89-
according to these rules:
55+
上で説明したように、出力は1つのkubeconfigファイルから作られる場合も、複数のkubeconfigファイルをマージした結果となる場合もあります。
9056

91-
* Ignore empty filenames.
92-
* Produce errors for files with content that cannot be deserialized.
93-
* The first file to set a particular value or map key wins.
94-
* Never change the value or map key.
95-
Example: Preserve the context of the first file to set `current-context`.
96-
Example: If two files specify a `red-user`, use only values from the first file's `red-user`.
97-
Even if the second file has non-conflicting entries under `red-user`, discard them.
57+
`kubectl`がkubeconfigファイルをマージするときに使用するルールを以下に示します。
9858

99-
For an example of setting the `KUBECONFIG` environment variable, see
100-
[Setting the KUBECONFIG environment variable](/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable).
59+
1. もし`--kubeconfig`フラグが設定されていた場合、指定したファイルだけが使用されます。マージは行いません。このフラグに指定できるのは1つのファイルだけです。
10160

102-
Otherwise, use the default kubeconfig file, `$HOME/.kube/config`, with no merging.
61+
そうでない場合、`KUBECONFIG`環境変数が設定されていた場合には、それをマージするべきファイルのリストとして使用します。`KUBECONFIG`環境変数にリストされたファイルのマージは、次のようなルールに従って行われます。
10362

104-
1. Determine the context to use based on the first hit in this chain:
63+
* 空のファイルを無視する。
64+
* デシリアライズできない内容のファイルに対してエラーを出す。
65+
* 特定の値やmapのキーを設定する最初のファイルが勝つ。
66+
* 値やmapのキーは決して変更しない。
67+
例: 最初のファイルが指定した`current-context`を保持する。
68+
例: 2つのファイルが`red-user`を指定した場合、1つ目のファイルの`red-user`だけを使用する。もし2つ目のファイルの`red-user`以下に競合しないエントリーがあったとしても、それらは破棄する。
10569

106-
1. Use the `--context` command-line flag if it exists.
107-
1. Use the `current-context` from the merged kubeconfig files.
70+
`KUBECONFIG`環境変数を設定する例については、[KUBECONFIG環境変数を設定する](/ja/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable)を参照してください。
10871

109-
An empty context is allowed at this point.
72+
それ以外の場合は、デフォルトのkubeconfigファイル`$HOME/.kube/config`をマージせずに使用します。
11073

111-
1. Determine the cluster and user. At this point, there might or might not be a context.
112-
Determine the cluster and user based on the first hit in this chain,
113-
which is run twice: once for user and once for cluster:
74+
1. 以下のチェーンで最初に見つかったものをもとにして、使用するcontextを決定する。
11475

115-
1. Use a command-line flag if it exists: `--user` or `--cluster`.
116-
1. If the context is non-empty, take the user or cluster from the context.
76+
1. `--context`コマンドラインフラグが存在すれば、それを使用する。
77+
1. マージしたkubeconrfigファイルから`current-context`を使用する。
11778

118-
The user and cluster can be empty at this point.
79+
この時点では、空のcontextも許容されます。
11980

120-
1. Determine the actual cluster information to use. At this point, there might or
121-
might not be cluster information.
122-
Build each piece of the cluster information based on this chain; the first hit wins:
81+
1. クラスターとユーザーを決定する。この時点では、contextである場合もそうでない場合もあります。以下のチェーンで最初に見つかったものをもとにして、クラスターとユーザーを決定します。この手順はユーザーとクラスターについてそれぞれ1回ずつ、合わせて2回実行されます。
12382

124-
1. Use command line flags if they exist: `--server`, `--certificate-authority`, `--insecure-skip-tls-verify`.
125-
1. If any cluster information attributes exist from the merged kubeconfig files, use them.
126-
1. If there is no server location, fail.
83+
1. もし存在すれば、コマンドラインフラグ`--user`または`--cluster`を使用する。
84+
1. もしcontextが空でなければ、contextからユーザーまたはクラスターを取得する。
12785

128-
1. Determine the actual user information to use. Build user information using the same
129-
rules as cluster information, except allow only one authentication
130-
technique per user:
86+
この時点では、ユーザーとクラスターは空である可能性があります。
13187

132-
1. Use command line flags if they exist: `--client-certificate`, `--client-key`, `--username`, `--password`, `--token`.
133-
1. Use the `user` fields from the merged kubeconfig files.
134-
1. If there are two conflicting techniques, fail.
88+
1. 使用する実際のクラスター情報を決定する。この時点では、クラスター情報は存在しない可能性があります。以下のチェーンで最初に見つかったものをもとにして、クラスター情報の各パーツをそれぞれを構築します。
13589

136-
1. For any information still missing, use default values and potentially
137-
prompt for authentication information.
90+
1. もし存在すれば、`--server``--certificate-authority``--insecure-skip-tls-verify`コマンドラインフラグを使用する。
91+
1. もしマージしたkubeconfigファイルにクラスター情報の属性が存在すれば、それを使用する。
92+
1. もしサーバーの場所が存在しなければ、マージは失敗する。
13893

139-
## File references
94+
1. 使用する実際のユーザー情報を決定する。クラスター情報の場合と同じルールを使用して、ユーザー情報を構築します。ただし、ユーザーごとに許可される認証方法は1つだけです。
14095

141-
File and path references in a kubeconfig file are relative to the location of the kubeconfig file.
142-
File references on the command line are relative to the current working directory.
143-
In `$HOME/.kube/config`, relative paths are stored relatively, and absolute paths
144-
are stored absolutely.
96+
1. もし存在すれば、`--client-certificate``--client-key``--username``--password``--token`コマンドラインフラグを使用する。
97+
1. マージしたkubeconfigファイルの`user`フィールドを使用する。
98+
1. もし2つの競合する方法が存在する場合、マージは失敗する。
14599

100+
1. もし何らかの情報がまだ不足していれば、デフォルトの値を使用し、認証情報については場合によってはプロンプトを表示する。
146101

102+
## ファイルリファレンス
147103

104+
kubeconfigファイル内のファイルとパスのリファレンスは、kubeconfigファイルの位置からの相対パスで指定します。コマンドライン上のファイルのリファレンスは、現在のワーキングディレクトリからの相対パスです。`$HOME/.kube/config`内では、相対パスは相対のまま、絶対パスは絶対のまま保存されます。
148105

149106
## {{% heading "whatsnext" %}}
150107

151108

152-
* [Configure Access to Multiple Clusters](/docs/tasks/access-application-cluster/configure-access-multiple-clusters/)
109+
* [複数のクラスターへのアクセスを設定する](/docs/tasks/access-application-cluster/configure-access-multiple-clusters/)
153110
* [`kubectl config`](/docs/reference/generated/kubectl/kubectl-commands#config)
154111

155112

content/ja/docs/tasks/access-application-cluster/configure-access-multiple-clusters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ contexts:
232232

233233
上記の設定ファイルは、`dev-ramp-up`というコンテキストを表します。
234234

235-
## KUBECONFIG環境変数を設定する
235+
## KUBECONFIG環境変数を設定する {#set-the-kubeconfig-environment-variable}
236236

237237
`KUBECONFIG`という環境変数が存在するかを確認してください。もし存在する場合は、後で復元できるようにバックアップしてください。例えば:
238238

0 commit comments

Comments
 (0)