Tutorials:Set up your Kubernetes user account
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.
> cd ~
> mkdir .kube
> chmod 700 .kube
Create a file ".kube/config" and edit its contents as follows. To get the certificate authority data right, download it here: File:Kubeconfig template ccu.
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJ ....
server: https://ccu.uni-konstanz.de:6443
name: ccu
contexts:
- context:
cluster: ""
user: ""
name: ccu
- context:
cluster: ccu
namespace: testing
user: your.username
name: me@ccu
current-context: ccu
kind: Config
preferences: {}
users:
- name: your.username
Of course, substitute your own username at the indicated locations. You will later learn what to do about the namespace.
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:
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:
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.