Changes

Jump to navigation Jump to search

Tutorials:Set up your Kubernetes user account

1,512 bytes added, 6 years ago
m
no edit summary
Unfortunately, making your identity known to the cluster on any machine is a decidedly manual process, which involves editing a local configuration that resides in ".kube/config".
 
== Set up a .kube/config file ==
 
Create the subdirectory ".kube" in your home and set restrictive permissions. It will contain your cluster credentials, and anyone who has access to the files in there can steal your identity and impersonate you. We do not want this.
 
<syntaxhighlight lang="bash">
> cd ~
> mkdir .kube
> chmod 700 .kube
</syntaxhighlight>
 
Create a file ".kube/config" and edit its contents as follows:
 
<syntaxhighlight lang="yaml">
</syntaxhighlight>
 
Of course, substitute your own username at the indicated locations.
== Get your user credentials (an OAuth ID token) from our server ==
 
The next step is to authenticate against our server, which will then create a credential (basically a secret token which only you should know) so that you can prove to the cluster that you are indeed who you claim you are. Go to [] and enter your CCU login. You will get something like this in return:
 
<syntaxhighlight lang="yaml">
</syntaxhighlight>
== Copy your credentials to the config and enter the CCU context ==
 
Finally, copy paste the above output from your web browser to your ".kube/config" so that it looks like this:
 
<syntaxhighlight lang="yaml">
</syntaxhighlight>
 
If you have some background in programming, the structure of the config file should be pretty obvious, and you will be able to extend it to include e.g. multiple identities and contexts which access different namespaces. This is quite useful for quickly switching between them without having to type so much.

Navigation menu