Skip to content

Commit f065fba

Browse files
committed
[zh-cn]sync kubectl_set_subject.md
Signed-off-by: xin.li <xin.li@daocloud.io>
1 parent 279f5c9 commit f065fba

File tree

1 file changed

+55
-49
lines changed

1 file changed

+55
-49
lines changed

content/zh-cn/docs/reference/kubectl/generated/kubectl_set/kubectl_set_subject.md

Lines changed: 55 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ kubectl set subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupna
2525

2626
<!--
2727
```
28-
# Update a cluster role binding for serviceaccount1
29-
kubectl set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1
30-
31-
# Update a role binding for user1, user2, and group1
32-
kubectl set subject rolebinding admin --user=user1 --user=user2 --group=group1
33-
34-
# Print the result (in YAML format) of updating rolebinding subjects from a local, without hitting the server
35-
kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=client | kubectl set subject --local -f - --user=foo -o yaml
28+
# Update a cluster role binding for serviceaccount1
29+
kubectl set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1
30+
31+
# Update a role binding for user1, user2, and group1
32+
kubectl set subject rolebinding admin --user=user1 --user=user2 --group=group1
33+
34+
# Print the result (in YAML format) of updating rolebinding subjects from a local, without hitting the server
35+
kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=client | kubectl set subject --local -f - --user=foo -o yaml
3636
```
3737
-->
3838
```shell
@@ -48,7 +48,7 @@ kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=cli
4848

4949
## {{% heading "options" %}}
5050

51-
<table style="width: 100%; table-layout: fixed;">
51+
<table style="width: 100%; table-layout: fixed;">
5252
<colgroup>
5353
<col span="1" style="width: 10px;" />
5454
<col span="1" />
@@ -64,7 +64,8 @@ kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=cli
6464
Select all resources, in the namespace of the specified resource types
6565
-->
6666
在指定资源类型的命名空间中,选择所有资源。
67-
</p></td>
67+
</p>
68+
</td>
6869
</tr>
6970

7071
<tr>
@@ -77,7 +78,8 @@ If true, ignore any errors in templates when a field or map key is missing in th
7778
-->
7879
如果为 true,在模板中字段或映射键缺失时忽略模板中的错误。
7980
仅适用于 golang 和 jsonpath 输出格式。
80-
</p></td>
81+
</p>
82+
</td>
8183
</tr>
8284

8385
<tr>
@@ -90,7 +92,8 @@ Must be &quot;none&quot;, &quot;server&quot;, or &quot;client&quot;. If client s
9092
-->
9193
必须是 "none"、"server" 或 "client"。如果是 client 策略,仅打印将要发送的对象,而不实际发送。
9294
如果是 server 策略,提交服务器端请求而不持久化资源。
93-
</p></td>
95+
</p>
96+
</td>
9497
</tr>
9598

9699
<tr>
@@ -102,7 +105,8 @@ Must be &quot;none&quot;, &quot;server&quot;, or &quot;client&quot;. If client s
102105
Name of the manager used to track field ownership.
103106
-->
104107
用于跟踪字段属主关系的管理器的名称。
105-
</p></td>
108+
</p>
109+
</td>
106110
</tr>
107111

108112
<tr>
@@ -114,7 +118,8 @@ Name of the manager used to track field ownership.
114118
Filename, directory, or URL to files the resource to update the subjects
115119
-->
116120
文件名、目录或文件 URL 的列表,用于标识要更新主体的资源。
117-
</p></td>
121+
</p>
122+
</td>
118123
</tr>
119124

120125
<tr>
@@ -126,7 +131,8 @@ Filename, directory, or URL to files the resource to update the subjects
126131
Groups to bind to the role
127132
-->
128133
要绑定到角色的组列表。
129-
</p></td>
134+
</p>
135+
</td>
130136
</tr>
131137

132138
<tr>
@@ -138,7 +144,8 @@ Groups to bind to the role
138144
help for subject
139145
-->
140146
subject 操作的帮助命令。
141-
</p></td>
147+
</p>
148+
</td>
142149
</tr>
143150

144151
<tr>
@@ -150,7 +157,8 @@ subject 操作的帮助命令。
150157
Process the kustomization directory. This flag can't be used together with -f or -R.
151158
-->
152159
处理 kustomization 目录。此标志不能与 -f 或 -R 一起使用。
153-
</p></td>
160+
</p>
161+
</td>
154162
</tr>
155163

156164
<tr>
@@ -161,8 +169,9 @@ Process the kustomization directory. This flag can't be used together with -f or
161169
<!--
162170
If true, set subject will NOT contact api-server but run locally.
163171
-->
164-
如果为真,`set subject` 将不会与 API 服务器通信,而是在本地运行。
165-
</p></td>
172+
如果为真,<code>set subject</code> 将不会与 API 服务器通信,而是在本地运行。
173+
</p>
174+
</td>
166175
</tr>
167176

168177
<tr>
@@ -175,7 +184,8 @@ Output format. One of: (json, yaml, name, go-template, go-template-file, templat
175184
-->
176185
输出格式。可选值为:
177186
json、yaml、name、go-template、go-template-file、template、templatefile、jsonpath、jsonpath-as-json、jsonpath-file。
178-
</p></td>
187+
</p>
188+
</td>
179189
</tr>
180190

181191
<tr>
@@ -187,7 +197,8 @@ json、yaml、name、go-template、go-template-file、template、templatefile、
187197
Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
188198
-->
189199
递归处理在 -f、--filename 中给出的目录。当你想要管理位于同一目录中的相关清单时很有用。
190-
</p></td>
200+
</p>
201+
</td>
191202
</tr>
192203

193204
<tr>
@@ -215,7 +226,8 @@ Selector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.
215226
Service accounts to bind to the role
216227
-->
217228
要绑定到角色的服务账号列表。
218-
</p></td>
229+
</p>
230+
</td>
219231
</tr>
220232

221233
<tr>
@@ -227,7 +239,8 @@ Service accounts to bind to the role
227239
If true, keep the managedFields when printing objects in JSON or YAML format.
228240
-->
229241
如果为真,在以 JSON 或 YAML 格式打印对象时保留 managedFields。
230-
</p></td>
242+
</p>
243+
</td>
231244
</tr>
232245

233246
<tr>
@@ -240,7 +253,8 @@ Template string or path to template file to use when -o=go-template, -o=go-templ
240253
-->
241254
当 -o=go-template、-o=go-template-file 时使用的模板字符串或模板文件路径。
242255
模板格式为 golang 模板 [http://golang.org/pkg/text/template/#pkg-overview]
243-
</p></td>
256+
</p>
257+
</td>
244258
</tr>
245259

246260
<tr>
@@ -375,30 +389,6 @@ The name of the kubeconfig context to use
375389
</p></td>
376390
</tr>
377391

378-
<tr>
379-
<td colspan="2">--default-not-ready-toleration-seconds int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: 300-->默认值:300</td>
380-
</tr>
381-
<tr>
382-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
383-
<!--
384-
Indicates the tolerationSeconds of the toleration for notReady:NoExecute that is added by default to every pod that does not already have such a toleration.
385-
-->
386-
设置针对 notReady:NoExecute 的容忍度的 tolerationSeconds,默认添加到所有尚未设置此容忍度的 Pod。
387-
</p></td>
388-
</tr>
389-
390-
<tr>
391-
<td colspan="2">--default-unreachable-toleration-seconds int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: 300-->默认值:300</td>
392-
</tr>
393-
<tr>
394-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
395-
<!--
396-
Indicates the tolerationSeconds of the toleration for unreachable:NoExecute that is added by default to every pod that does not already have such a toleration.
397-
-->
398-
设置针对 unreachable:NoExecute 的容忍度的 tolerationSeconds,默认添加到所有尚未设置此容忍度的 Pod。
399-
</p></td>
400-
</tr>
401-
402392
<tr>
403393
<td colspan="2">--disable-compression</td>
404394
</tr>
@@ -432,7 +422,23 @@ If true, the server's certificate will not be checked for validity. This will ma
432422
Path to the kubeconfig file to use for CLI requests.
433423
-->
434424
CLI 请求要使用的 kubeconfig 文件的路径。
435-
</p></td>
425+
</p>
426+
</td>
427+
</tr>
428+
429+
<tr>
430+
<td colspan="2">--kuberc string</td>
431+
</tr>
432+
<tr>
433+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
434+
<p>
435+
<!--
436+
Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.
437+
-->
438+
用于偏好设置的 kuberc 文件的路径。可以通过导出 KUBECTL_KUBERC=false
439+
特性门控或关闭 KUBERC=off 特性来禁用此功能。
440+
</p>
441+
</td>
436442
</tr>
437443

438444
<tr>

0 commit comments

Comments
 (0)