1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl config set-credentials - Set a user entry in kubeconfig
10
11
12
14 kubectl config set-credentials [OPTIONS]
15
16
17
19 Set a user entry in kubeconfig.
20
21
22 Specifying a name that already exists will merge new fields on top of
23 existing values.
24
25
26 Client-certificate flags:
27 --client-certificate=certfile --client-key=keyfile
28
29
30 Bearer token flags:
31 --token=bearer_token
32
33
34 Basic auth flags:
35 --username=basic_user --password=basic_password
36
37
38 Bearer token and basic auth are mutually exclusive.
39
40
41
43 --auth-provider="" Auth provider for the user entry in kubeconfig
44
45
46 --auth-provider-arg=[] 'key=value' arguments for the auth provider
47
48
49 --client-certificate="" Path to client-certificate file for the
50 user entry in kubeconfig
51
52
53 --client-key="" Path to client-key file for the user entry in
54 kubeconfig
55
56
57 --embed-certs=false Embed client cert/key for the user entry in
58 kubeconfig
59
60
61 --exec-api-version="" API version of the exec credential plugin
62 for the user entry in kubeconfig
63
64
65 --exec-arg=[] New arguments for the exec credential plugin command
66 for the user entry in kubeconfig
67
68
69 --exec-command="" Command for the exec credential plugin for the
70 user entry in kubeconfig
71
72
73 --exec-env=[] 'key=value' environment values for the exec creden‐
74 tial plugin
75
76
77 --password="" password for the user entry in kubeconfig
78
79
80 --token="" token for the user entry in kubeconfig
81
82
83 --username="" username for the user entry in kubeconfig
84
85
86
88 --as="" Username to impersonate for the operation. User could be a
89 regular user or a service account in a namespace.
90
91
92 --as-group=[] Group to impersonate for the operation, this flag
93 can be repeated to specify multiple groups.
94
95
96 --as-uid="" UID to impersonate for the operation.
97
98
99 --azure-container-registry-config="" Path to the file containing
100 Azure container registry configuration information.
101
102
103 --cache-dir="/builddir/.kube/cache" Default cache directory
104
105
106 --certificate-authority="" Path to a cert file for the certificate
107 authority
108
109
110 --cluster="" The name of the kubeconfig cluster to use
111
112
113 --context="" The name of the kubeconfig context to use
114
115
116 --disable-compression=false If true, opt-out of response compres‐
117 sion for all requests to the server
118
119
120 --insecure-skip-tls-verify=false If true, the server's certificate
121 will not be checked for validity. This will make your HTTPS connections
122 insecure
123
124
125 --kubeconfig="" use a particular kubeconfig file
126
127
128 --match-server-version=false Require server version to match
129 client version
130
131
132 -n, --namespace="" If present, the namespace scope for this CLI
133 request
134
135
136 --profile="none" Name of profile to capture. One of
137 (none|cpu|heap|goroutine|threadcreate|block|mutex)
138
139
140 --profile-output="profile.pprof" Name of the file to write the
141 profile to
142
143
144 --request-timeout="0" The length of time to wait before giving up
145 on a single server request. Non-zero values should contain a corre‐
146 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
147 out requests.
148
149
150 -s, --server="" The address and port of the Kubernetes API server
151
152
153 --tls-server-name="" Server name to use for server certificate
154 validation. If it is not provided, the hostname used to contact the
155 server is used
156
157
158 --user="" The name of the kubeconfig user to use
159
160
161 --version=false Print version information and quit
162
163
164 --warnings-as-errors=false Treat warnings received from the server
165 as errors and exit with a non-zero exit code
166
167
168
170 # Set only the "client-key" field on the "cluster-admin"
171 # entry, without touching other values
172 kubectl config set-credentials cluster-admin --client-key=~/.kube/admin.key
173
174 # Set basic auth for the "cluster-admin" entry
175 kubectl config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif
176
177 # Embed client certificate data in the "cluster-admin" entry
178 kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs=true
179
180 # Enable the Google Compute Platform auth provider for the "cluster-admin" entry
181 kubectl config set-credentials cluster-admin --auth-provider=gcp
182
183 # Enable the OpenID Connect auth provider for the "cluster-admin" entry with additional args
184 kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-id=foo --auth-provider-arg=client-secret=bar
185
186 # Remove the "client-secret" config value for the OpenID Connect auth provider for the "cluster-admin" entry
187 kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-secret-
188
189 # Enable new exec auth plugin for the "cluster-admin" entry
190 kubectl config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1
191
192 # Define new exec auth plugin args for the "cluster-admin" entry
193 kubectl config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2
194
195 # Create or update exec auth plugin environment variables for the "cluster-admin" entry
196 kubectl config set-credentials cluster-admin --exec-env=key1=val1 --exec-env=key2=val2
197
198 # Remove exec auth plugin environment variables for the "cluster-admin" entry
199 kubectl config set-credentials cluster-admin --exec-env=var-to-remove-
200
201
202
203
205 kubectl-config(1),
206
207
208
210 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
211 com) based on the kubernetes source material, but hopefully they have
212 been automatically generated since!
213
214
215
216Manuals User KUBERNETES(1)(kubernetes)