1KUBERNETES(1)(kubernetes)                            KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7

NAME

9       kubectl  set  subject - Update the user, group, or service account in a
10       role binding or cluster role binding
11
12
13

SYNOPSIS

15       kubectl set subject [OPTIONS]
16
17
18

DESCRIPTION

20       Update the user, group, or service account in a role binding or cluster
21       role binding.
22
23
24

OPTIONS

26       --all=false       Select  all resources, in the namespace of the speci‐
27       fied resource types
28
29
30       --allow-missing-template-keys=true      If true, ignore any  errors  in
31       templates  when a field or map key is missing in the template. Only ap‐
32       plies to golang and jsonpath output formats.
33
34
35       --dry-run="none"      Must be "none", "server", or "client". If  client
36       strategy, only print the object that would be sent, without sending it.
37       If server strategy, submit server-side request without  persisting  the
38       resource.
39
40
41       --field-manager="kubectl-set"       Name  of  the manager used to track
42       field ownership.
43
44
45       -f, --filename=[]      Filename, directory, or URL  to  files  the  re‐
46       source to update the subjects
47
48
49       --group=[]      Groups to bind to the role
50
51
52       -k,  --kustomize=""      Process the kustomization directory. This flag
53       can't be used together with -f or -R.
54
55
56       --local=false      If true, set subject will NOT contact api-server but
57       run locally.
58
59
60       -o,  --output=""      Output format. One of: (json, yaml, name, go-tem‐
61       plate, go-template-file, template, templatefile, jsonpath, jsonpath-as-
62       json, jsonpath-file).
63
64
65       -R, --recursive=false      Process the directory used in -f, --filename
66       recursively. Useful when you want to manage related manifests organized
67       within the same directory.
68
69
70       -l,  --selector=""       Selector  (label query) to filter on, supports
71       '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects
72       must satisfy all of the specified label constraints.
73
74
75       --serviceaccount=[]      Service accounts to bind to the role
76
77
78       --show-managed-fields=false       If  true, keep the managedFields when
79       printing objects in JSON or YAML format.
80
81
82       --template=""      Template string or path to template file to use when
83       -o=go-template, -o=go-template-file. The template format is golang tem‐
84       plates [http://golang.org/pkg/text/template/#pkg-overview].
85
86
87       --user=[]      Usernames to bind to the role
88
89
90

OPTIONS INHERITED FROM PARENT COMMANDS

92       --as=""      Username to impersonate for the operation. User could be a
93       regular user or a service account in a namespace.
94
95
96       --as-group=[]       Group  to  impersonate for the operation, this flag
97       can be repeated to specify multiple groups.
98
99
100       --as-uid=""      UID to impersonate for the operation.
101
102
103       --azure-container-registry-config=""      Path to the  file  containing
104       Azure container registry configuration information.
105
106
107       --cache-dir="/builddir/.kube/cache"      Default cache directory
108
109
110       --certificate-authority=""      Path to a cert file for the certificate
111       authority
112
113
114       --client-certificate=""      Path to a client certificate file for TLS
115
116
117       --client-key=""      Path to a client key file for TLS
118
119
120       --cluster=""      The name of the kubeconfig cluster to use
121
122
123       --context=""      The name of the kubeconfig context to use
124
125
126       --disable-compression=false      If true, opt-out of response  compres‐
127       sion for all requests to the server
128
129
130       --insecure-skip-tls-verify=false      If true, the server's certificate
131       will not be checked for validity. This will make your HTTPS connections
132       insecure
133
134
135       --kubeconfig=""       Path  to  the  kubeconfig file to use for CLI re‐
136       quests.
137
138
139       --match-server-version=false       Require  server  version  to   match
140       client version
141
142
143       -n,  --namespace=""       If  present, the namespace scope for this CLI
144       request
145
146
147       --password=""      Password for basic authentication to the API server
148
149
150       --profile="none"        Name   of   profile   to   capture.   One    of
151       (none|cpu|heap|goroutine|threadcreate|block|mutex)
152
153
154       --profile-output="profile.pprof"       Name  of  the  file to write the
155       profile to
156
157
158       --request-timeout="0"      The length of time to wait before giving  up
159       on  a  single  server  request. Non-zero values should contain a corre‐
160       sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
161       out requests.
162
163
164       -s, --server=""      The address and port of the Kubernetes API server
165
166
167       --tls-server-name=""       Server  name  to  use for server certificate
168       validation. If it is not provided, the hostname  used  to  contact  the
169       server is used
170
171
172       --token=""      Bearer token for authentication to the API server
173
174
175       --username=""      Username for basic authentication to the API server
176
177
178       --version=false      Print version information and quit
179
180
181       --warnings-as-errors=false      Treat warnings received from the server
182       as errors and exit with a non-zero exit code
183
184
185

EXAMPLE

187                # Update a cluster role binding for serviceaccount1
188                kubectl set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1
189
190                # Update a role binding for user1, user2, and group1
191                kubectl set subject rolebinding admin --user=user1 --user=user2 --group=group1
192
193                # Print the result (in YAML format) of updating rolebinding subjects from a local, without hitting the server
194                kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=client | kubectl set subject --local -f - --user=foo -o yaml
195
196
197
198

SEE ALSO

200       kubectl-set(1),
201
202
203

HISTORY

205       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
206       com)  based  on the kubernetes source material, but hopefully they have
207       been automatically generated since!
208
209
210
211Manuals                              User            KUBERNETES(1)(kubernetes)
Impressum