Skip to content

Commit ea55456

Browse files
authored
Merge branch 'master' into patch-1
2 parents ad11931 + 4b99762 commit ea55456

File tree

7 files changed

+821
-671
lines changed

7 files changed

+821
-671
lines changed

content/en/docs/concepts/services-networking/ingress-controllers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Kubernetes as a project supports and maintains [AWS](https://github.com/kubernet
2727
* [Ambassador](https://www.getambassador.io/) API Gateway is an [Envoy](https://www.envoyproxy.io)-based ingress
2828
controller.
2929
* [Apache APISIX ingress controller](https://github.com/apache/apisix-ingress-controller) is an [Apache APISIX](https://github.com/apache/apisix)-based ingress controller.
30+
* [Avi Kubernetes Operator](https://github.com/vmware/load-balancer-and-ingress-services-for-kubernetes) provides L4-L7 load-balancing using [VMware NSX Advanced Load Balancer](https://avinetworks.com/).
3031
* The [Citrix ingress controller](https://github.com/citrix/citrix-k8s-ingress-controller#readme) works with
3132
Citrix Application Delivery Controller.
3233
* [Contour](https://projectcontour.io/) is an [Envoy](https://www.envoyproxy.io/) based ingress controller.

content/en/docs/concepts/storage/persistent-volumes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ If expanding underlying storage fails, the cluster administrator can manually re
311311
PersistentVolume types are implemented as plugins. Kubernetes currently supports the following plugins:
312312

313313
* [`awsElasticBlockStore`](/docs/concepts/storage/volumes/#awselasticblockstore) - AWS Elastic Block Store (EBS)
314-
* [`azureDisk`](/docs/concepts/sotrage/volumes/#azuredisk) - Azure Disk
314+
* [`azureDisk`](/docs/concepts/storage/volumes/#azuredisk) - Azure Disk
315315
* [`azureFile`](/docs/concepts/storage/volumes/#azurefile) - Azure File
316316
* [`cephfs`](/docs/concepts/storage/volumes/#cephfs) - CephFS volume
317317
* [`cinder`](/docs/concepts/storage/volumes/#cinder) - Cinder (OpenStack block storage)

content/en/docs/setup/production-environment/container-runtimes.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,44 @@ sudo mkdir -p /etc/containerd
143143
sudo containerd config default | sudo tee /etc/containerd/config.toml
144144
```
145145

146+
```shell
147+
# Restart containerd
148+
sudo systemctl restart containerd
149+
```
150+
{{% /tab %}}
151+
{{% tab name="Debian 9+" %}}
152+
153+
```shell
154+
# (Install containerd)
155+
## Set up the repository
156+
### Install packages to allow apt to use a repository over HTTPS
157+
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
158+
```
159+
160+
```shell
161+
## Add Docker's official GPG key
162+
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key --keyring /etc/apt/trusted.gpg.d/docker.gpg add -
163+
```
164+
165+
```shell
166+
## Add Docker apt repository.
167+
sudo add-apt-repository \
168+
"deb [arch=amd64] https://download.docker.com/linux/debian \
169+
$(lsb_release -cs) \
170+
stable"
171+
```
172+
173+
```shell
174+
## Install containerd
175+
sudo apt-get update && sudo apt-get install -y containerd.io
176+
```
177+
178+
```shell
179+
# Set default containerd configuration
180+
sudo mkdir -p /etc/containerd
181+
containerd config default | sudo tee /etc/containerd/config.toml
182+
```
183+
146184
```shell
147185
# Restart containerd
148186
sudo systemctl restart containerd
@@ -523,4 +561,3 @@ sudo systemctl enable docker
523561

524562
Refer to the [official Docker installation guides](https://docs.docker.com/engine/installation/)
525563
for more information.
526-

content/ja/docs/reference/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ content_type: concept
3131
## CLIリファレンス
3232

3333
* [kubectl](/docs/reference/kubectl/overview/) - コマンドの実行やKubernetesクラスターの管理に使う主要なCLIツールです。
34-
* [JSONPath](/docs/reference/kubectl/jsonpath/) - kubectlで[JSONPath記法](https://goessner.net/articles/JsonPath/)を使うための構文ガイドです。
34+
* [JSONPath](/ja/docs/reference/kubectl/jsonpath/) - kubectlで[JSONPath記法](https://goessner.net/articles/JsonPath/)を使うための構文ガイドです。
3535
* [kubeadm](/docs/reference/setup-tools/kubeadm/kubeadm/) - セキュアなKubernetesクラスターを簡単にプロビジョニングするためのCLIツールです。
3636

3737
## コンポーネントリファレンス
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
title: JSONPathのサポート
3+
content_type: concept
4+
weight: 25
5+
---
6+
7+
<!-- overview -->
8+
kubectlはJSONPathのテンプレートをサポートしています。
9+
10+
<!-- body -->
11+
12+
JSONPathのテンプレートは、波括弧`{}`によって囲まれたJSONPathの式によって構成されています。
13+
kubectlでは、JSONPathの式を使うことで、JSONオブジェクトの特定のフィールドをフィルターしたり、出力のフォーマットを変更することができます。
14+
本来のJSONPathのテンプレートの構文に加え、以下の機能と構文が使えます:
15+
16+
1. JSONPathの式の内部でテキストをクォートするために、ダブルクォーテーションを使用します。
17+
2. リストを反復するために、`range``end`オペレーターを使用します。
18+
3. リストを末尾側から参照するために、負の数のインデックスを使用します。負の数のインデックスはリストを「周回」せず、`-index + listLength >= 0`が満たされる限りにおいて有効になります。
19+
20+
{{< note >}}
21+
22+
- 式は常にルートのオブジェクトから始まるので、`$`オペレーターの入力は任意になります。
23+
24+
- 結果のオブジェクトはString()関数を適用した形で表示されます。
25+
26+
{{< /note >}}
27+
28+
以下のようなJSONの入力が与えられたとします。
29+
30+
```json
31+
{
32+
"kind": "List",
33+
"items":[
34+
{
35+
"kind":"None",
36+
"metadata":{"name":"127.0.0.1"},
37+
"status":{
38+
"capacity":{"cpu":"4"},
39+
"addresses":[{"type": "LegacyHostIP", "address":"127.0.0.1"}]
40+
}
41+
},
42+
{
43+
"kind":"None",
44+
"metadata":{"name":"127.0.0.2"},
45+
"status":{
46+
"capacity":{"cpu":"8"},
47+
"addresses":[
48+
{"type": "LegacyHostIP", "address":"127.0.0.2"},
49+
{"type": "another", "address":"127.0.0.3"}
50+
]
51+
}
52+
}
53+
],
54+
"users":[
55+
{
56+
"name": "myself",
57+
"user": {}
58+
},
59+
{
60+
"name": "e2e",
61+
"user": {"username": "admin", "password": "secret"}
62+
}
63+
]
64+
}
65+
```
66+
67+
機能 | 説明 | 例 | 結果
68+
--------------------|---------------------------|-----------------------------------------------------------------|------------------
69+
`text` | プレーンテキスト | `kind is {.kind}` | `kind is List`
70+
`@` | 現在のオブジェクト | `{@}` | 入力した値と同じ値
71+
`.` or `[]` | 子要素 | `{.kind}`, `{['kind']}` or `{['name\.type']}` | `List`
72+
`..` | 子孫要素を再帰的に探す | `{..name}` | `127.0.0.1 127.0.0.2 myself e2e`
73+
`*` | ワイルドカード。すべてのオブジェクトを取得する | `{.items[*].metadata.name}` | `[127.0.0.1 127.0.0.2]`
74+
`[start:end:step]` | 添字 | `{.users[0].name}` | `myself`
75+
`[,]` | 和集合 | `{.items[*]['metadata.name', 'status.capacity']}` | `127.0.0.1 127.0.0.2 map[cpu:4] map[cpu:8]`
76+
`?()` | フィルター | `{.users[?(@.name=="e2e")].user.password}` | `secret`
77+
`range`, `end` | リストの反復 | `{range .items[*]}[{.metadata.name}, {.status.capacity}] {end}` | `[127.0.0.1, map[cpu:4]] [127.0.0.2, map[cpu:8]]`
78+
`''` | 解釈済みの文字列をクォートする | `{range .items[*]}{.metadata.name}{'\t'}{end}` | `127.0.0.1 127.0.0.2`
79+
80+
`kubectl`とJSONPathの式を使った例:
81+
82+
```shell
83+
kubectl get pods -o json
84+
kubectl get pods -o=jsonpath='{@}'
85+
kubectl get pods -o=jsonpath='{.items[0]}'
86+
kubectl get pods -o=jsonpath='{.items[0].metadata.name}'
87+
kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'status.capacity']}"
88+
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'
89+
```
90+
91+
{{< note >}}
92+
Windowsでは、空白が含まれるJSONPathのテンプレートをクォートする場合は(上記のようにシングルクォーテーションを使うのではなく)、ダブルクォーテーションを使わなければなりません。
93+
また、テンプレート内のリテラルをクォートする際には、シングルクォーテーションか、エスケープされたダブルクォーテーションを使わなければなりません。例えば:
94+
95+
```cmd
96+
kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.status.startTime}{'\n'}{end}"
97+
kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.startTime}{\"\n\"}{end}"
98+
```
99+
{{< /note >}}
100+
101+
{{< note >}}
102+
103+
JSONPathの正規表現はサポートされていません。正規表現を利用した検索を行いたい場合は、`jq`のようなツールを使ってください。
104+
105+
```shell
106+
# kubectlはJSONpathの出力として正規表現をサポートしていないので、以下のコマンドは動作しない
107+
kubectl get pods -o jsonpath='{.items[?(@.metadata.name=~/^test$/)].metadata.name}'
108+
109+
# 上のコマンドに期待される結果が欲しい場合、以下のコマンドを使うとよい
110+
kubectl get pods -o json | jq -r '.items[] | select(.metadata.name | test("test-")).spec.containers[].image'
111+
```
112+
{{< /note >}}

content/ja/docs/reference/kubectl/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ kubectl [command] [TYPE] [NAME] -o <output_format>
191191
`-o custom-columns=<spec>` | [カスタムカラム](#custom-columns)のコンマ区切りのリストを使用して、テーブルを表示します。
192192
`-o custom-columns-file=<filename>` | `<filename>`ファイル内の[カスタムカラム](#custom-columns)のテンプレートを使用して、テーブルを表示します。
193193
`-o json` | JSON形式のAPIオブジェクトを出力します。
194-
`-o jsonpath=<template>` | [jsonpath](/docs/reference/kubectl/jsonpath/)式で定義されたフィールドを表示します。
195-
`-o jsonpath-file=<filename>` | `<filename>`ファイル内の[jsonpath](/docs/reference/kubectl/jsonpath/)式で定義されたフィールドを表示します。
194+
`-o jsonpath=<template>` | [jsonpath](/ja/docs/reference/kubectl/jsonpath/)式で定義されたフィールドを表示します。
195+
`-o jsonpath-file=<filename>` | `<filename>`ファイル内の[jsonpath](/ja/docs/reference/kubectl/jsonpath/)式で定義されたフィールドを表示します。
196196
`-o name` | リソース名のみを表示します。
197197
`-o wide` | 追加情報を含めて、プレーンテキスト形式で出力します。Podの場合は、Node名が含まれます。
198198
`-o yaml` | YAML形式のAPIオブジェクトを出力します。
@@ -263,7 +263,7 @@ pod-name 1m
263263

264264
### オブジェクトリストのソート
265265

266-
ターミナルウィンドウで、オブジェクトをソートされたリストに出力するには、サポートされている`kubectl`コマンドに`--sort-by`フラグを追加します。`--sort-by`フラグで任意の数値フィールドや文字列フィールドを指定することで、オブジェクトをソートします。フィールドの指定には、[jsonpath](/docs/reference/kubectl/jsonpath/)式を使用します。
266+
ターミナルウィンドウで、オブジェクトをソートされたリストに出力するには、サポートされている`kubectl`コマンドに`--sort-by`フラグを追加します。`--sort-by`フラグで任意の数値フィールドや文字列フィールドを指定することで、オブジェクトをソートします。フィールドの指定には、[jsonpath](/ja/docs/reference/kubectl/jsonpath/)式を使用します。
267267

268268
#### 構文
269269

0 commit comments

Comments
 (0)