1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl set subject - Update User, Group or ServiceAccount in a
7 RoleBinding/ClusterRoleBinding
8
9
10
12 kubectl set subject [OPTIONS]
13
14
15
17 Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBind‐
18 ing.
19
20
21
23 --all=false
24 Select all resources, including uninitialized ones, in the names‐
25 pace of the specified resource types
26
27
28 --allow-missing-template-keys=true
29 If true, ignore any errors in templates when a field or map key is
30 missing in the template. Only applies to golang and jsonpath output
31 formats.
32
33
34 --dry-run=false
35 If true, only print the object that would be sent, without sending
36 it.
37
38
39 -f, --filename=[]
40 Filename, directory, or URL to files the resource to update the
41 subjects
42
43
44 --group=[]
45 Groups to bind to the role
46
47
48 --include-uninitialized=false
49 If true, the kubectl command applies to uninitialized objects. If
50 explicitly set to false, this flag overrides other flags that make the
51 kubectl commands apply to uninitialized objects, e.g., "--all". Objects
52 with empty metadata.initializers are regarded as initialized.
53
54
55 -k, --kustomize=""
56 Process the kustomization directory. This flag can't be used
57 together with -f or -R.
58
59
60 --local=false
61 If true, set subject will NOT contact api-server but run locally.
62
63
64 -o, --output=""
65 Output format. One of: json|yaml|name|go-template|go-tem‐
66 plate-file|template|templatefile|jsonpath|jsonpath-file.
67
68
69 -R, --recursive=false
70 Process the directory used in -f, --filename recursively. Useful
71 when you want to manage related manifests organized within the same
72 directory.
73
74
75 -l, --selector=""
76 Selector (label query) to filter on, not including uninitialized
77 ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
78
79
80 --serviceaccount=[]
81 Service accounts to bind to the role
82
83
84 --template=""
85 Template string or path to template file to use when -o=go-tem‐
86 plate, -o=go-template-file. The template format is golang templates [
87 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
88
89
90
92 --alsologtostderr=false
93 log to standard error as well as files
94
95
96 --application-metrics-count-limit=100
97 Max number of application metrics to store (per container)
98
99
100 --as=""
101 Username to impersonate for the operation
102
103
104 --as-group=[]
105 Group to impersonate for the operation, this flag can be repeated
106 to specify multiple groups.
107
108
109 --azure-container-registry-config=""
110 Path to the file containing Azure container registry configuration
111 information.
112
113
114 --boot-id-file="/proc/sys/kernel/random/boot_id"
115 Comma-separated list of files to check for boot-id. Use the first
116 one that exists.
117
118
119 --cache-dir="/builddir/.kube/http-cache"
120 Default HTTP cache directory
121
122
123 --certificate-authority=""
124 Path to a cert file for the certificate authority
125
126
127 --client-certificate=""
128 Path to a client certificate file for TLS
129
130
131 --client-key=""
132 Path to a client key file for TLS
133
134
135 --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
136 CIDRs opened in GCE firewall for LB traffic proxy health checks
137
138
139 --cluster=""
140 The name of the kubeconfig cluster to use
141
142
143 --container-hints="/etc/cadvisor/container_hints.json"
144 location of the container hints file
145
146
147 --containerd="/run/containerd/containerd.sock"
148 containerd endpoint
149
150
151 --containerd-namespace="k8s.io"
152 containerd namespace
153
154
155 --context=""
156 The name of the kubeconfig context to use
157
158
159 --default-not-ready-toleration-seconds=300
160 Indicates the tolerationSeconds of the toleration for
161 notReady:NoExecute that is added by default to every pod that does not
162 already have such a toleration.
163
164
165 --default-unreachable-toleration-seconds=300
166 Indicates the tolerationSeconds of the toleration for unreach‐
167 able:NoExecute that is added by default to every pod that does not
168 already have such a toleration.
169
170
171 --docker="unix:///var/run/docker.sock"
172 docker endpoint
173
174
175 --docker-env-metadata-whitelist=""
176 a comma-separated list of environment variable keys that needs to
177 be collected for docker containers
178
179
180 --docker-only=false
181 Only report docker containers in addition to root stats
182
183
184 --docker-root="/var/lib/docker"
185 DEPRECATED: docker root is read from docker info (this is a fall‐
186 back, default: /var/lib/docker)
187
188
189 --docker-tls=false
190 use TLS to connect to docker
191
192
193 --docker-tls-ca="ca.pem"
194 path to trusted CA
195
196
197 --docker-tls-cert="cert.pem"
198 path to client certificate
199
200
201 --docker-tls-key="key.pem"
202 path to private key
203
204
205 --enable-load-reader=false
206 Whether to enable cpu load reader
207
208
209 --event-storage-age-limit="default=0"
210 Max length of time for which to store events (per type). Value is a
211 comma separated list of key values, where the keys are event types
212 (e.g.: creation, oom) or "default" and the value is a duration. Default
213 is applied to all non-specified event types
214
215
216 --event-storage-event-limit="default=0"
217 Max number of events to store (per type). Value is a comma sepa‐
218 rated list of key values, where the keys are event types (e.g.: cre‐
219 ation, oom) or "default" and the value is an integer. Default is
220 applied to all non-specified event types
221
222
223 --global-housekeeping-interval=1m0s
224 Interval between global housekeepings
225
226
227 --housekeeping-interval=10s
228 Interval between container housekeepings
229
230
231 --insecure-skip-tls-verify=false
232 If true, the server's certificate will not be checked for validity.
233 This will make your HTTPS connections insecure
234
235
236 --kubeconfig=""
237 Path to the kubeconfig file to use for CLI requests.
238
239
240 --log-backtrace-at=:0
241 when logging hits line file:N, emit a stack trace
242
243
244 --log-cadvisor-usage=false
245 Whether to log the usage of the cAdvisor container
246
247
248 --log-dir=""
249 If non-empty, write log files in this directory
250
251
252 --log-file=""
253 If non-empty, use this log file
254
255
256 --log-file-max-size=1800
257 Defines the maximum size a log file can grow to. Unit is megabytes.
258 If the value is 0, the maximum file size is unlimited.
259
260
261 --log-flush-frequency=5s
262 Maximum number of seconds between log flushes
263
264
265 --logtostderr=true
266 log to standard error instead of files
267
268
269 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
270 Comma-separated list of files to check for machine-id. Use the
271 first one that exists.
272
273
274 --match-server-version=false
275 Require server version to match client version
276
277
278 -n, --namespace=""
279 If present, the namespace scope for this CLI request
280
281
282 --password=""
283 Password for basic authentication to the API server
284
285
286 --profile="none"
287 Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
288 create|block|mutex)
289
290
291 --profile-output="profile.pprof"
292 Name of the file to write the profile to
293
294
295 --request-timeout="0"
296 The length of time to wait before giving up on a single server
297 request. Non-zero values should contain a corresponding time unit (e.g.
298 1s, 2m, 3h). A value of zero means don't timeout requests.
299
300
301 -s, --server=""
302 The address and port of the Kubernetes API server
303
304
305 --skip-headers=false
306 If true, avoid header prefixes in the log messages
307
308
309 --skip-log-headers=false
310 If true, avoid headers when opening log files
311
312
313 --stderrthreshold=2
314 logs at or above this threshold go to stderr
315
316
317 --storage-driver-buffer-duration=1m0s
318 Writes in the storage driver will be buffered for this duration,
319 and committed to the non memory backends as a single transaction
320
321
322 --storage-driver-db="cadvisor"
323 database name
324
325
326 --storage-driver-host="localhost:8086"
327 database host:port
328
329
330 --storage-driver-password="root"
331 database password
332
333
334 --storage-driver-secure=false
335 use secure connection with database
336
337
338 --storage-driver-table="stats"
339 table name
340
341
342 --storage-driver-user="root"
343 database username
344
345
346 --token=""
347 Bearer token for authentication to the API server
348
349
350 --update-machine-info-interval=5m0s
351 Interval between machine info updates.
352
353
354 --user=""
355 The name of the kubeconfig user to use
356
357
358 --username=""
359 Username for basic authentication to the API server
360
361
362 -v, --v=0
363 number for the log level verbosity
364
365
366 --version=false
367 Print version information and quit
368
369
370 --vmodule=
371 comma-separated list of pattern=N settings for file-filtered log‐
372 ging
373
374
375
377 # Update a ClusterRoleBinding for serviceaccount1
378 kubectl set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1
379
380 # Update a RoleBinding for user1, user2, and group1
381 kubectl set subject rolebinding admin --user=user1 --user=user2 --group=group1
382
383 # Print the result (in yaml format) of updating rolebinding subjects from a local, without hitting the server
384 kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run | kubectl set subject --local -f - --user=foo -o yaml
385
386
387
388
390 kubectl-set(1),
391
392
393
395 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
396 com) based on the kubernetes source material, but hopefully they have
397 been automatically generated since!
398
399
400
401Eric Paris kubernetes User Manuals KUBERNETES(1)