File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
content/zh/docs/tasks/access-application-cluster Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -107,17 +107,17 @@ Pod is returned instead of a list of items.
107
107
{{< /note >}}
108
108
109
109
<!--
110
- ## List Containers by Pod
110
+ ## List Container images by Pod
111
111
112
112
The formatting can be controlled further by using the `range` operation to
113
113
iterate over elements individually.
114
114
-->
115
- ## 列出 Pod 中的容器
115
+ ## 按 Pod 列出容器镜像
116
116
117
117
可以使用 ` range ` 操作进一步控制格式化,以单独操作每个元素。
118
118
119
119
``` shell
120
- kubectl get pods --all-namespaces -o= jsonpath=' {range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}' | \
120
+ kubectl get pods --all-namespaces -o jsonpath=' {range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}' | \
121
121
sort
122
122
```
123
123
@@ -132,7 +132,7 @@ following matches only Pods with labels matching `app=nginx`.
132
132
要获取匹配特定标签的 Pod,请使用 -l 参数。以下匹配仅与标签 ` app=nginx ` 相符的 Pod。
133
133
134
134
``` shell
135
- kubectl get pods --all-namespaces -o= jsonpath=" {.items[*].spec.containers[*].image}" -l app=nginx
135
+ kubectl get pods --all-namespaces -o jsonpath=" {.items[*].spec.containers[*].image}" -l app=nginx
136
136
```
137
137
138
138
<!--
You can’t perform that action at this time.
0 commit comments