You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/resource-browser.md
+75Lines changed: 75 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -449,3 +449,78 @@ spec:
449
449
- containerPort: 80
450
450
```
451
451
{% endcode %}
452
+
453
+
---
454
+
455
+
## Port Forwarding
456
+
457
+
### Introduction
458
+
459
+
Assume your applications are running in a Kubernetes cluster on cloud. Now, if you wish to test or debug them on your local machine, you can perform [port forwarding](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/). It creates a tunnel between a port on your machine and a port on a resource within your cluster. Therefore, you can access applications running inside the cluster as though they are running locally on your machine.
460
+
461
+
But first, you would need access to that cluster. Traditionally, the kubeconfig file (`./kube/config`) helps you connect with the cluster.
Kubeconfig becomes painstakingly difficult to maintain especially when it comes to:
468
+
* Granting or revoking access to the cluster for multiple people
469
+
* Changing the permissions and subsequently the access token
470
+
* Adding/Updating/Deleting the entries of cluster URLs and tokens
471
+
* Keeping a record of multiple kubeconfig files
472
+
473
+
### Our Solution
474
+
475
+
Devtron helps in reducing the challenges and simplifying the maintenance of kubeconfig file through:
476
+
* **Devtron's Proxy URL for Cluster** - A standardized URL that you can use in place of your Kubernetes cluster URL.
477
+
* **Devtron's Access Token** - A kubectl-compatible token which can be generated and centrally maintained from [Global Configurations → Authorization → API tokens](./global-configurations/authorization/api-tokens.md).
478
+
479
+
### Steps
480
+
481
+
**Prerequisite**: An [API token with necessary permissions](./global-configurations/authorization/api-tokens.md) for the user(s) to access the cluster.
482
+
483
+
If you are not a super-admin and can't generate a token yourself, you can find the session token (argocd.token) using the Developer Tools available in your web browser as shown below.
484
+
485
+

486
+
487
+
1. Go to `~/.kube` folder on your local machine and open the `config` file. Or you may create one with the following content:
3. Test the connection to the cluster by running any kubectl command, e.g., `kubectl get ns` or `kubectl get po -A`
522
+
523
+
4. Once you have successfully connected to the cluster, you may run the port-forward command. Refer [kubectl port-forward](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_port-forward/) to see a few examples.
524
+
525
+

0 commit comments