Skip to content

Commit 2b00840

Browse files
levi106Ubuntu
authored andcommitted
Translate content/en/docs/tasks/tools/install-kubectl-linux..md
1 parent 2cc93fe commit 2b00840

File tree

2 files changed

+100
-109
lines changed

2 files changed

+100
-109
lines changed

content/ja/docs/tasks/tools/included/optional-kubectl-configs-bash-linux.md

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,68 @@
11
---
2-
title: "bash auto-completion on Linux"
3-
description: "Some optional configuration for bash auto-completion on Linux."
2+
title: "Linux上でのbashの自動補完"
3+
description: "Linux上でのbashの自動補完に対するいくつかの補助的な設定。"
44
headless: true
55
_build:
66
list: never
77
render: never
88
publishResources: false
99
---
1010

11-
### Introduction
11+
### はじめに
1212

13-
The kubectl completion script for Bash can be generated with the command `kubectl completion bash`.
14-
Sourcing the completion script in your shell enables kubectl autocompletion.
13+
Bashにおけるkubectlの補完スクリプトは`kubectl completion bash`コマンドで生成できます。
14+
シェル内で補完スクリプトをsourceすることでkubectlの自動補完が有効になります。
1515

16-
However, the completion script depends on
17-
[**bash-completion**](https://github.com/scop/bash-completion),
18-
which means that you have to install this software first
19-
(you can test if you have bash-completion already installed by running `type _init_completion`).
16+
ただし、補完スクリプトは[**bash-completion**](https://github.com/scop/bash-completion)に依存しているため、事前にインストールしておく必要があります(`type _init_completion`を実行することで、bash-completionがすでにインストールされていることを確認できます)。
2017

21-
### Install bash-completion
18+
### bash-completionをインストールする
2219

23-
bash-completion is provided by many package managers
24-
(see [here](https://github.com/scop/bash-completion#installation)).
25-
You can install it with `apt-get install bash-completion` or `yum install bash-completion`, etc.
20+
bash-completionは多くのパッケージマネージャーから提供されています([こちら](https://github.com/scop/bash-completion#installation)を参照してください)。
21+
`apt-get install bash-completion`または`yum install bash-completion`などでインストールできます。
2622

27-
The above commands create `/usr/share/bash-completion/bash_completion`,
28-
which is the main script of bash-completion. Depending on your package manager,
29-
you have to manually source this file in your `~/.bashrc` file.
23+
上記のコマンドでbash-completionの主要スクリプトである`/usr/share/bash-completion/bash_completion`が作成されます。
24+
パッケージマネージャーによっては、このファイルを`~/.bashrc`にて手動でsourceする必要があります。
3025

31-
To find out, reload your shell and run `type _init_completion`.
32-
If the command succeeds, you're already set, otherwise add the following to your `~/.bashrc` file:
26+
これを調べるには、シェルをリロードしてから`type _init_completion`を実行してください。
27+
コマンドが成功していればすでに設定済みです。そうでなければ、`~/.bashrc`ファイルに以下を追記してください:
3328

3429
```bash
3530
source /usr/share/bash-completion/bash_completion
3631
```
3732

38-
Reload your shell and verify that bash-completion is correctly installed by typing `type _init_completion`.
33+
シェルをリロードし、`type _init_completion`を実行してbash-completionが正しくインストールされていることを検証してください。
3934

40-
### Enable kubectl autocompletion
35+
### kubectlの自動補完を有効にする
4136

4237
#### Bash
4338

44-
You now need to ensure that the kubectl completion script gets sourced in all
45-
your shell sessions. There are two ways in which you can do this:
39+
すべてのシェルセッションにてkubectlの補完スクリプトをsourceできるようにしなければなりません。
40+
これを行うには2つの方法があります:
4641

4742
{{< tabs name="kubectl_bash_autocompletion" >}}
48-
{{< tab name="User" codelang="bash" >}}
43+
{{< tab name="ユーザー" codelang="bash" >}}
4944
echo 'source <(kubectl completion bash)' >>~/.bashrc
5045
{{< /tab >}}
51-
{{< tab name="System" codelang="bash" >}}
46+
{{< tab name="システム" codelang="bash" >}}
5247
kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl > /dev/null
5348
sudo chmod a+r /etc/bash_completion.d/kubectl
5449
{{< /tab >}}
5550
{{< /tabs >}}
5651

57-
If you have an alias for kubectl, you can extend shell completion to work with that alias:
52+
kubectlにエイリアスを張っている場合は、エイリアスでも動作するようにシェルの補完を拡張することができます:
5853

5954
```bash
6055
echo 'alias k=kubectl' >>~/.bashrc
6156
echo 'complete -o default -F __start_kubectl k' >>~/.bashrc
6257
```
6358

6459
{{< note >}}
65-
bash-completion sources all completion scripts in `/etc/bash_completion.d`.
60+
bash-completionは`/etc/bash_completion.d`内のすべての補完スクリプトをsourceします。
6661
{{< /note >}}
6762

68-
Both approaches are equivalent. After reloading your shell, kubectl autocompletion should be working.
69-
To enable bash autocompletion in current session of shell, source the ~/.bashrc file:
63+
どちらも同様の手法です。
64+
シェルをリロードしたあとに、kubectlの自動補完が機能するはずです。
65+
シェルの現在のセッションでbashの自動補完を有効にするには、~/.bashrcをsourceします:
7066

7167
```bash
7268
source ~/.bashrc

0 commit comments

Comments
 (0)