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

NAME

9       kubectl config set-credentials - Set a user entry in kubeconfig
10
11
12

SYNOPSIS

14       kubectl config set-credentials [OPTIONS]
15
16
17

DESCRIPTION

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

OPTIONS

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       --embed-certs=false      Embed client cert/key for the  user  entry  in
50       kubeconfig
51
52
53       --exec-api-version=""       API  version  of the exec credential plugin
54       for the user entry in kubeconfig
55
56
57       --exec-arg=[]      New arguments for the exec credential plugin command
58       for the user entry in kubeconfig
59
60
61       --exec-command=""       Command  for the exec credential plugin for the
62       user entry in kubeconfig
63
64
65       --exec-env=[]      'key=value' environment values for the exec  creden‐
66       tial plugin
67
68
69

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

164                # Set only the "client-key" field on the "cluster-admin"
165                # entry, without touching other values
166                kubectl config set-credentials cluster-admin --client-key=~/.kube/admin.key
167
168                # Set basic auth for the "cluster-admin" entry
169                kubectl config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif
170
171                # Embed client certificate data in the "cluster-admin" entry
172                kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs=true
173
174                # Enable the Google Compute Platform auth provider for the "cluster-admin" entry
175                kubectl config set-credentials cluster-admin --auth-provider=gcp
176
177                # Enable the OpenID Connect auth provider for the "cluster-admin" entry with additional args
178                kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-id=foo --auth-provider-arg=client-secret=bar
179
180                # Remove the "client-secret" config value for the OpenID Connect auth provider for the "cluster-admin" entry
181                kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-secret-
182
183                # Enable new exec auth plugin for the "cluster-admin" entry
184                kubectl config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1
185
186                # Define new exec auth plugin args for the "cluster-admin" entry
187                kubectl config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2
188
189                # Create or update exec auth plugin environment variables for the "cluster-admin" entry
190                kubectl config set-credentials cluster-admin --exec-env=key1=val1 --exec-env=key2=val2
191
192                # Remove exec auth plugin environment variables for the "cluster-admin" entry
193                kubectl config set-credentials cluster-admin --exec-env=var-to-remove-
194
195
196
197

SEE ALSO

199       kubectl-config(1),
200
201
202

HISTORY

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