Skip to content

Add api to get cluster nodes' resources #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2020

Conversation

cesnietor
Copy link
Collaborator

fixes #259

A List of nodes in the cluster will be returned.
List Response will show Node's taints, capacity and allocatable resources.

GET /api/v1/cluster/resources

Response example:

{
    "nodes": [
        {
            "allocatable_resources": {
                "cpu": 6,
                "ephemeral-storage": 62725623808,
                "hugepages-1Gi": 0,
                "hugepages-2Mi": 0,
                "memory": 4131528704,
                "pods": 110
            },
            "name": "kind-control-plane",
            "taints": {
                "no_execute": null,
                "no_schedule": null,
                "prefer_no_schedule": null
            },
            "total_resources": {
                "cpu": 6,
                "ephemeral-storage": 62725623808,
                "hugepages-1Gi": 0,
                "hugepages-2Mi": 0,
                "memory": 4131528704,
                "pods": 110
            }
        },
        {
            "allocatable_resources": {
                "cpu": 6,
                "ephemeral-storage": 62725623808,
                "hugepages-1Gi": 0,
                "hugepages-2Mi": 0,
                "memory": 4131528704,
                "pods": 110
            },
            "name": "kind-worker2",
            "taints": {
                "no_execute": [
                    "node.min.io/drain=drain:NoExecute"
                ],
                "no_schedule": [
                    "node.kubernetes.io/unschedulable:NoSchedule"
                ],
                "prefer_no_schedule": null
            },
            "total_resources": {
                "cpu": 6,
                "ephemeral-storage": 62725623808,
                "hugepages-1Gi": 0,
                "hugepages-2Mi": 0,
                "memory": 4131528704,
                "pods": 110
            }
        }
    ]
}
  • Tests Added

@cesnietor cesnietor self-assigned this Aug 28, 2020
Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

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

LGTM

@dvaldivia dvaldivia merged commit 30f5943 into minio:master Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add API to retrieve memory capacity + allocable from all nodes
3 participants