Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
* [App Details](user-guide/creating-application/app-details.md)
* [Debugging Deployment And Monitoring](user-guide/debugging-deployment-and-monitoring.md)
* [Application Metrics](user-guide/creating-application/app-metrics.md)
* [Overview](user-guide/creating-application/overview.md)
* [Overview](user-guide/creating-application/overview.md)
* [Resource Browser](user-guide/resource-browser.md)
* [Charts](user-guide/deploy-chart/README.md)
* [Charts Overview](user-guide/deploy-chart/overview-of-charts.md)
* [Deploy & Observe](user-guide/deploy-chart/deployment-of-charts.md)
Expand All @@ -77,6 +78,7 @@
* [Deploying MongoDB Helm Chart](user-guide/deploy-chart/examples/deploying-mongodb-helm-chart.md)
* [Chart Group](user-guide/deploy-chart/chart-group.md)
* [Security](user-guide/security-features.md)
* [Clusters](user-guide/clusters.md)
* [Bulk Edit](user-guide/bulk-update.md)
* [Integrations](user-guide/integrations/README.md)
* [Build and Deploy (CI/CD)](user-guide/integrations/build-and-deploy-ci-cd.md)
Expand Down
206 changes: 206 additions & 0 deletions docs/user-guide/clusters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# Clusters

Devtron allows you to manage your Kubernetes cluster by:
* Browsing information of cluster and its resources.
* Managing the added resources to meet the requirements for high speed and storage capacity.
* Managing Cluster resources with Kubernetes requests and limits and also individual containers.
* Debugging a pod or node by connecting to a terminal.

On the left navigation of Devtron, select `Clusters`. You will find the list of clusters in this section which you have added under [Global Configurations > Clusters & Environments](https://docs.devtron.ai/global-configurations/cluster-and-environments).

You can also search the cluster in the `Search Clusters` bar.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/clusters-latest.jpg)


| Fields | Description |
| --- | --- |
| **Cluster** | User-defined name for the cluster in Devtron. E.g. `default-cluster` |
| **Connection Status** | Status of the cluster. The status can be either `Successful` or `Failed`. |
| **Nodes** | Shows the number of nodes in a cluster. |
| **Node Errors** | Shows the error in nodes. |
| **K8s Version** | Shows the version of Kubernetes cluster. |
| **CPU Capacity** | Shows the CPU capacity in your cluster in milicore. E.g., 8000m where 1000 milicore equals to 1 core. |
| **Memory Capacity** | Shows the memory capacity in your cluster in mebibytes. |

To see the details of resource allocation and usage of the cluster, click the particular cluster.

## Resources

On the `Resource allocation and usage`, you can see the details of compute resources or resources.

* CPU resources
* Memory resources

If you specify a `request` and `limits` in the container resource manifest file, then the respective values will appear on the `Resource allocation and usage` section.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/resource-allocation-usage-latest.jpg)

## Nodes

You can see the list of nodes available in your cluster. Typically you have several nodes in a cluster; in a learning or resource-limited environment, you might have only one node.

The components on a typical node include the `kubelet`, a `container runtime`, and the `kube-proxy`.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/select-a-node-latest.jpg)

If you have multiple nodes, you can search a node by name or label in the search bar.

| Fields | Description |
| --- | --- |
| **Node** | User-defined name for the node in Devtron. E.g. `demo-new`.<br>Note: Two nodes cannot have the same name at the same time.</br> |
| **Status** | Status of a node. It can be either `Ready` or `Not Ready`. |
| **Roles** | Shows the roles of a node. |
| **Errors** | Shows the error in nodes. |
| **K8s Version** | Shows the version of Kubernetes cluster. |
| **No. of Pods** | Shows the number of namespaces or pods in a node. |
| **CPU Usage** | Shows the CPU consumption in a node. |
| **Mem Usage** | Shows the memory consumption in a node |
| **Age** | Shows the time that the pod has been running since the last restart. |

To display a parameter of a node, use the `Columns` on the right side, select the parameter you want to display from the drop-down list and click `Apply`.

## Manage Nodes

Your applications run on pods, and pods run on Nodes. But sometimes, Kubernetes scheduler cannot deploy a pod on a Node for several reasons. As an example, node is not ready, node is not reachable, network is unavailable etc.

Using the Devtron UI, you will be able to:
* [Debug a node](#debug-a-node)
* [Cordon a node](#cordon-a-node)
* [Drain a node](#drain-a-node)
* [Taint a node](#taint-node)
* [Configure YAML](#configure-yaml)
* [Delete a node](#delete-a-node)

To see the summary of a node, click the specific node.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/summary-of-a-node.jpg)

### Debug a Node

You can debug a node via Terminal by selecting your namespace and image from the list that has all CLI utilities like kubectl, helm, netshoot etc. or can use a custom image, which is publicly available.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/node-terminal.png)

* Go to the `Clusters` section from the left navigation pane.
* Select your cluster.
* Search a node by name or label in the search bar.
* On the node, click the ellipsis button and then click `Terminal`.
* Debug a node by selecting the terminal shell `bash` or `sh`.


### Cordon a Node

Cordoning a node means making the node unschedulable. After cordoning a node, new Pods cannot be scheduled on this node.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/node-cordon.jpg)

* On the node, click the ellipsis button and then click `Cordon`.
* A dialog box with message `Cordoning this node will mark this node as unschedulable. By cordoning a node, you can be sure that no new pods will be scheduled on this node` is displayed.
* The status of the node shows `SchedulingDisabled` with `Unschedulable` parameter set as `true`.

Similarly, you can uncordon a node by clicking `Uncordon`. After a node is uncordoned, new Pods can be scheduled on the node.

### Drain a Node

Before performing maintenance on a node, draining a node evicts all of your pods safely from a node. Safe evictions allow the pod’s containers to gracefully terminate and will manage the `PodDisruptionBudgets` you have specified (if relevant).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will manage the PodDisruptionBudgets -> honour the PodDisruptionBudgets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


After the node is drained, all Pods (including those managed by DaemonSets) in the node will be automatically drained to other nodes in the cluster, and the drained node will be set to cordoned status.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/drain-node.jpg)

* On the node, click the ellipsis button and then click `Drain`.
* A dialog box with message `Drain will cordon off the node and evict all pods of the node` is displayed.
* Click `Drain Node`.

You can also select from the following conditions before draining a node:

| Name | Usage |
| --- | --- |
| **Grace Period** | Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used. |
| **Delete empty directory data** | Enabling this field will delete the pods using empty directory data when the node is drained. |
| **Disable eviction (use with caution** | Enabling this field will force drain to use delete, even if eviction is supported. This will bypass checking `PodDisruptionBudgets`.<br>Note: Make sure to use with caution.</br> |
| **Force drain** | Enabling this field will force drain a node even if there are pods that do not declare a controller. |
| **Ignore DaemonSets** | Enabling this field will ignore DaemonSet-managed pods. |

### Taint a Node

Taints are `key:value` pairs associated with effect. After you add taints to nodes, you can set tolerations on a pod to allow the pod to be scheduled to nodes with certain taints. When you taint a node, it will repel all the pods except those that have a toleration for that taint. A node can have one or many taints associated with it.

**Note**: Make sure to check taint validations before you add a taint.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/edit-taints.jpg)

* On the node, click the ellipsis button and then click `Edit taints`.
* Click `Add taint`.
* On the `Key` and `Value` fields, enter the `key:value` pairs and select the [taint effect](#taint-effects) from the drop-down list.
* Click `Save`.
* You can also delete the added taint by clicking delete button.

#### Taint Effects

A taint can produce three possible effects:

| Effect | Description |
| --- | --- |
| **NoSchedule** | The Kubernetes scheduler will only allow scheduling pods that have tolerations for the tainted nodes. |
| **PreferNoSchedule** | The Kubernetes scheduler will try to avoid scheduling pods that do not have tolerations for the tainted nodes. |
| **NoExecute** | Kubernetes will evict the running pods from the nodes if the pods do not have tolerations for the tainted nodes. |

### Configure YAML

The config.yaml file contains all the configuration settings that are needed to deploy your cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its node edit, not he cluster edit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/edit-yaml-node.jpg)

* You can edit or modify the parameters or values of a node by clicking `YAML`.
* Click `Review Changes` to compare the changes in the YAML file.
* Click `Update Node`.


### Delete a Node

* Go to the `Clusters` section from the left navigation pane.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write this document with context of cluster-detail page

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for any change in app config you don't start with app listing page

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* Select your cluster.
* Search a node by name or label in the search bar.
* On the node, click the ellipsis button and then click `Delete`.

The node will be deleted from the cluster.


## Access Cluster via Terminal for Troubleshooting

User with [Super admins](https://docs.devtron.ai/global-configurations/authorization/user-access#assign-super-admin-permissions) access can now troubleshoot cluster issues by accessing the cluster terminal from Devtron. You can select an image from the list that has all CLI utilities like kubectl, helm, netshoot etc. or can use a custom image, which is publicly available.

To troubleshoot a cluster or a specific node in a cluster, click the terminal symbol on the right side.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/clusters/cluster-terminal-access.jpg)

* You will see the user-defined name for the cluster in Devtron. E.g. `default-cluster`.
* In the `Nodes` field, select the node from the drop-down list you want to troubleshoot. E.g. `demo-new`.
* Select the namespace from the drop-down list which you have added in the [Environment](https://docs.devtron.ai/global-configurations/cluster-and-environments#add-environment) section.
* Select the image from the drop-down list which includes all CLI utilities or you can use a custom image, which is publicly available.
* Select the terminal shell from the drop-down list (e.g. `sh`, `bash`) to troubleshoot a node.


### Debug Pod

You can also create pod for debugging which will connect to pod terminal. To find out why the particular pod is not running, you can check `Pod Events` and `Pod Manifest` for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how we are supporting this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Or you can also use the following commands to show events at the end of the output for the pod:

```bash
kubectl describe pod <podname>
```

or

```bash
kubectl get events
```

According to the `Pod Events` messages and `Pod Manifest`, you can debug a pod.

**Note**: A container can have no or multiple shells running in it. If you are not able to create a successfull connection, try changing the shell, as the container may not have that shell running.


10 changes: 5 additions & 5 deletions docs/user-guide/global-configurations/authorization/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
_**This documentaion consist of authorizations available in Devtron**_
`Authorization` section describes how to authenticate and authorize access to resources, also managing role-based access levels in Devtron.

**Parts of the documentaion**
Access can be added to a user via:

[User Permissions](user-access.md)
* [User Permissions](user-access.md)

[Permission Groups](permission-groups.md)
* [Permission Groups](permission-groups.md)

[API Tokens](api-tokens.md)
* [API Tokens](api-tokens.md)
53 changes: 27 additions & 26 deletions docs/user-guide/global-configurations/authorization/api-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,84 +4,85 @@ API tokens are the access tokens for authentication. Instead of using username a

## Generate API Token

To generate API tokens, go to Global Configurations -> Authorization -> API tokens and click `Generate New Token`.
To generate API tokens, go to `Global Configurations -> Authorization -> API tokens` and click `Generate New Token`.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-1.png)

1. Enter a name for the token.
2. Add Description.
* Enter a name for the token.
* Add Description.
* Select an expiration date for the token (7 days, 30 days, 60 days, 90 days, custom and no expiration).

3. Select an Expiration date for the token (7 days, 30 days, 60 days, 90 days, custom and no expiration).

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-2.png)

To select a custom expiration date, select `Custom` from the drop-down. This will pop-up a calender from where you can select your custom expiration date for the API token.
* To select a custom expiration date, select `Custom` from the drop-down list. In the adjacent field, you can select your custom expiration date for the API token.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-12.png)
![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-custom.png)

4. Assign permissions to the token. To generate a token with super admin permission, select super admin permission.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-4.png)
* You can assign permission to the token either with:

Or select specific permission if you want to generate a token with a specific role over a particular Devtron app or Helm app or chart group.
* **Super admin permission**: To generate a token with super admin permission, select `Super admin permission`.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-3.png)
* **Specific permissions**: Selecting `Specific permissions` option allows you to generate a token with a specific role for:<ul><li>`Devtron Apps`</li></ul><ul><li>`Helm Apps`</li></ul><ul><li>`Kubernetes Resources`</li></ul><ul><li>`Chart Groups`</li></ul>

5. Now click on Generate Token.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-specific-permissions-latest1.jpg)


A pop-up window will appear over the screen from where you can copy the API token.
* Click `Generate Token`.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-5.png)
A pop-up window will appear on the screen from where you can copy the API token.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-5.png)

## Use API Token

Once devtron api token has been generated, you can use this token to hit devtron apis using any api testing tool like Jmeter, postman, citrus. Using postman here.
Once Devtron API token has been generated, you can use this token to request Devtron APIs using any API testing tool like Jmeter, Postman, Citrus. Using Postman here as an example.

Open postman. Enter the request URL with POST method and under HEADERS, enter the API token as shown in the image below.
Open Postman. Enter the request URL with `POST` method and under HEADERS, enter the API token as shown in the image below.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-6.png)


Now, under body, provide the api payload as shown below and click on Send.
In the `Body` section, provide the API payload as shown below and click `Send`.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-7.png)

As soon as you click on send, the create application api will be triggered and a new devtron app will be created as you mentioned in the payload.
As soon as you click `Send`, the created application API will be triggered and a new Devtron app will be created as provided in the payload.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-8.png)


## Update API Token

To set a new expiration date or to make changes in permissions assigned to the token, we need to update the API token.
To update the API token, click over the token name or click on the edit icon.
To set a new expiration date or to make changes in permissions assigned to the token, we need to update the API token in Devtron.
To update the API token, click the token name or click on the edit icon.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-9.png)

To set a new expiration date, you can regenerate the API token. Any scripts or applications using this token will need to be updated. To regenerate a token, click on regenerate token. A pop-up window will appear on the screen from where you can select a new expiration date and then click on `regenerate token`.
To set a new expiration date, you can regenerate the API token. Any scripts or applications using this token must be updated. To regenerate a token, click `Regenerate token`.

A pop-up window will appear on the screen from where you can select a new expiration date.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-10.png)

Select a new expiration date and click on regenerated token.
Select a new expiration date and click `Regenerate token`.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-11.png)

This will generated a new token with a new expiration date.
This will generate a new token with a new expiration date.


To update API token permissions, give the permissions as you want to and click on update token.
To update API token permissions, give the permissions as you want to and click `Update Token`.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-3.png)



## Delete API Token

To delete an API token, click `delete` icon. Any applications or scripts using this token will no longer be able to access the Devtron API.

![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/api-token/api-token-14.png)




Expand Down
Loading