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.
You can read more about Access Profiles
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:
Download Kubeconfig
Delete
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:
curl https://dl.k8s.io/release/v1.25.0/bin/linux/amd64/kubectl
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.
You can read more about downloading Kubectl according to operation system
See a list of kubectl commands
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:
export KUBECONFIG=/home/Documents/kubeconfig.yaml
To make sure the value was added, you can use the echo command to show up the current kubeconfig value:
echo $KUBECONFIG
-
Creating the config file for authentication.
Be sure you are in in home directory.
/home/your_user
Create a new folder kube.
mkdir ~/.kube
Now, you must create the config file inside the kube folder. Its must contains all the content from the Kubeconfig file:
vim /.kube/config