Skip to content

Commit 2c6ed70

Browse files
Shubham9t9Shubham9t9
andauthored
docs: adding clusters on devtron using kubeconfig (#3494)
* documentation for adding clusters on devtron using kubeconfig * added a minor correction --------- Co-authored-by: Shubham9t9 <[email protected]>
1 parent 79bcebf commit 2c6ed70

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

docs/user-guide/global-configurations/cluster-and-environments.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ To add cluster, go to the `Clusters & Environments` section of `Global Configura
1010

1111
![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/cluster-and-environments/add-clusters.png)
1212

13-
Provide the information in the following fields to add your kubernetes cluster:
13+
### Add Clusters Using Server URL & Bearer Token
14+
15+
16+
To add a Kubernetes cluster on Devtron using `server url` and the `bearer token`, provide the information in the following fields:
1417

1518
| Field | Description |
1619
| :--- | :--- |
1720
| `Name` | Enter a name of your cluster. |
1821
| `Server URL` | Server URL of a cluster.<br>Note: We recommended to use a [self-hosted URL](#benefits-of-self-hosted-url) instead of cloud hosted URL.</br> |
1922
| `Bearer Token` | Bearer token of a cluster. |
2023

24+
![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/cluster-and-environments/add-cluster-cred.jpg)
25+
2126
### Get Cluster Credentials
2227

2328
>**Prerequisites:** `kubectl` must be installed on the bastion.
@@ -30,15 +35,15 @@ You can get the **`Server URL`** & **`Bearer Token`** by running the following c
3035
{% tab title="k8s Cluster Providers" %}
3136
If you are using EKS, AKS, GKE, Kops, Digital Ocean managed Kubernetes, run the following command to generate the server URL and bearer token:
3237
```bash
33-
curl -o https://raw.githubusercontent.com/devtron-labs/utilities/main/kubeconfig-exporter/kubernetes_export_sa.sh \
38+
curl -O https://raw.githubusercontent.com/devtron-labs/utilities/main/kubeconfig-exporter/kubernetes_export_sa.sh \
3439
&& bash kubernetes_export_sa.sh cd-user devtroncd
3540
```
3641
{% endtab %}
3742
{% tab title="Microk8s Cluster" %}
3843
If you are using a **`microk8s cluster`**, run the following command to generate the server URL and bearer token:
3944

4045
```bash
41-
curl -o https://raw.githubusercontent.com/devtron-labs/utilities/main/kubeconfig-exporter/kubernetes_export_sa.sh && sed -i 's/kubectl/microk8s kubectl/g' \
46+
curl -O https://raw.githubusercontent.com/devtron-labs/utilities/main/kubeconfig-exporter/kubernetes_export_sa.sh && sed -i 's/kubectl/microk8s kubectl/g' \
4247
kubernetes_export_sa.sh && bash kubernetes_export_sa.sh cd-user \
4348
devtroncd
4449
```
@@ -47,6 +52,8 @@ devtroncd
4752

4853
![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/cluster-and-environments/generate-cluster-credentials.png)
4954

55+
56+
5057
### Benefits of Self-hosted URL
5158

5259
* Disaster Recovery:
@@ -58,6 +65,27 @@ devtroncd
5865
* On the other hand, migration for a self-hosted URL is easy as the URL is of single hosted domain independent of the cloud provider.
5966

6067

68+
### Add Clusters Using Kubeconfig
69+
70+
To add clusters using kubeconfig, follow these steps:
71+
72+
1. First, navigate to the global configurations menu, and then go to "clusters and environment" section.
73+
74+
2. Click on the `Add cluster` button. In the options provided, choose the `From kubeconfig` option.
75+
76+
3. Next, either paste the kubeconfig file or browse for it and select the appropriate file.
77+
78+
4. Afterward, click on the `Get cluster` button. This action will display the cluster details alongside the kubeconfig.
79+
80+
![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/cluster-and-environments/add-cluster-kubeconfig.jpg)
81+
82+
5. Select the desired cluster and click on `Save` to successfully add the cluster to Devtron.
83+
84+
![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/cluster-and-environments/kubeconfig-save-cluster.jpg)
85+
86+
87+
**Note:** Please ensure that the kubeconfig file you use has `admin permissions`. It is crucial for Devtron to have the necessary administrative privileges; otherwise, it may encounter failures or disruptions during deployments and other operations. Admin permission is essential to ensure the smooth functioning of Devtron and to prevent any potential issues that may arise due to insufficient privileges.
88+
6189
### Configure Prometheus (Enable Applications Metrics)
6290

6391
If you want to see application metrics against the applications deployed in the cluster, Prometheus must be deployed in the cluster. Prometheus is a powerful tool to provide graphical insight into your application behavior.

0 commit comments

Comments
 (0)