At User Tab, select Projects. Click Kubeconfigs button
To access your cluster and virtual machines, you must add a SSH key to your Access Profile. It'll give the user total access to Kubemaster of the cluster from attached Projects.
Using Kubeconfig, you can allow users to access your cluster, but not servers. It means Kubeconfig is a yalm file that contains relevant infos to authenticate cluster and allow the use of its resources, keeping servers protection.
Create a new Kubeconfig
Click Add Kubeconfig in the upper right
Choose a Name: use at least 3 lowercase alphanumeric characters
- Choose a Namespace: isolated group located within the cluster
- Choose a Role: you can choose between admin/edit/view
- Select a Predefined Validity Period: choose a period the kubeconfig will expire
- Select a Kubeconfig Type:
- Personal Kubeconfig: only selected User is allowed
- Application Kubeconfig: choose if only project Managers are allowed, or all users with access to the project
- You can find a specific Kubeconfig using the Search Tab
At the Actions Tab, you can:
How to use Kubeconfig
The Kubeconfig file is used with the Kubectl command-line tool to access the cluster. You can download Kubectl:
- Using curl command-line tool, for example downloading the version 1.25.0:
The command makes a HTTP request, opening the URL in the Terminal.
- Using the native package management, with apt install command-line to access the Repository.
apt install kubectl
Note: you should choose Kubectl version according to your cluster's version.
Now, you have to download the Kubeconfig file . You have different ways to access Kubeconfig in your Terminal:
- Using --kubeconfig parameter in command line, directly referencing the location of the Kubeconfig file. Ex:
get pods --kubeconfig/home/Documents/kubeconfig.yaml
The parameter must be used in every command line to specify the kubeconfig file.
Adding a value to variable kubeconfig, using export parameter. You must indicate the location of the file. Ex:
To make sure the value was added, you can use the echo command to show up the current kubeconfig value:
Creating the config file for authentication.
Be sure you are in in home directory.
Create a new folder kube.
Now, you must create the config file inside the kube folder. Its must contains all the content from the Kubeconfig file: