{"id":34808544,"url":"https://github.com/dharmjit/k8s-dra-resources","last_synced_at":"2026-05-24T11:34:40.283Z","repository":{"id":309891590,"uuid":"1037907420","full_name":"dharmjit/k8s-dra-resources","owner":"dharmjit","description":"A library and a client to view K8s dra resources","archived":false,"fork":false,"pushed_at":"2025-08-14T10:16:29.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-14T12:14:43.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dharmjit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-14T10:00:51.000Z","updated_at":"2025-08-14T10:16:32.000Z","dependencies_parsed_at":"2025-08-14T12:15:27.728Z","dependency_job_id":"5b95baf8-952b-4c2b-91f7-992ae0cfb356","html_url":"https://github.com/dharmjit/k8s-dra-resources","commit_stats":null,"previous_names":["dharmjit/k8s-dra-resources"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dharmjit/k8s-dra-resources","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dharmjit%2Fk8s-dra-resources","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dharmjit%2Fk8s-dra-resources/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dharmjit%2Fk8s-dra-resources/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dharmjit%2Fk8s-dra-resources/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dharmjit","download_url":"https://codeload.github.com/dharmjit/k8s-dra-resources/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dharmjit%2Fk8s-dra-resources/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28029009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-25T12:12:21.627Z","updated_at":"2025-12-25T12:12:27.076Z","avatar_url":"https://github.com/dharmjit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-dra-resources\n\nA command-line tool and library to list and show the status of Kubernetes Dynamic Resource Allocation (DRA) resources.\n\n## Description\n\nThis tool provides a summary of nodes, their capacities, and the status of DRA resources. It helps administrators and developers to quickly see node details and which DRA-managed devices are available and which are allocated.\n\n## Command-Line Usage\n\nTo run the tool, you need to have a valid kubeconfig file. By default, it uses the `KUBECONFIG` environment variable or the recommended home file (`~/.kube/config`).\n\n```bash\ngo run cmd/main.go\n```\n\nYou can also specify the path to your kubeconfig file using the `-kubeconfig` flag:\n\n```bash\ngo run cmd/main.go -kubeconfig /path/to/your/kubeconfig\n```\n\n### Example Output\n\nThe output is a table that lists all nodes and their resource information.\n\n```sh\nNODE    ROLE    CPU(TOTAL/AVAIL)    MEMORY(TOTAL/AVAIL GiB) STORAGE(TOTAL/AVAIL)    DEVICES\nnode-1  master  12/11               31.25/30.25             100G/90G                gpu.nvidia.com: 2 total, 1 available\nnode-2  worker  8/7                 15.63/14.63             100G/90G                None\n```\n\n## Library Usage\n\nThis project can also be used as a library to fetch information about DRA resources programmatically.\n\n### Example\n\n```go\npackage main\n\nimport (\n \"context\"\n \"fmt\"\n \"os\"\n\n \"github.com/dharmjit/k8s-dra-resources/pkg/client\"\n)\n\nfunc main() {\n kubeconfig := os.Getenv(\"KUBECONFIG\")\n if kubeconfig == \"\" {\n  kubeconfig = clientcmd.RecommendedHomeFile\n }\n\n c, err := client.NewResourceClient(kubeconfig)\n if err != nil {\n  fmt.Fprintf(os.Stderr, \"Error creating DRA client: %v\\n\", err)\n  os.Exit(1)\n }\n\n nodeInfo, err := c.GetK8sResources(context.Background())\n if err != nil {\n  fmt.Fprintf(os.Stderr, \"Error getting resources: %v\\n\", err)\n  os.Exit(1)\n }\n\n for _, node := range nodeInfo {\n  fmt.Printf(\"Node: %s\\n\", node.NodeName)\n  fmt.Printf(\"  Role: %s\\n\", node.NodeRole)\n  fmt.Printf(\"  CPU (Total/Available): %s/%s\\n\", node.NodeCapacity.TotalCPU.String(), node.NodeCapacity.AvailableCPU.String())\n  // ... and so on\n }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdharmjit%2Fk8s-dra-resources","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdharmjit%2Fk8s-dra-resources","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdharmjit%2Fk8s-dra-resources/lists"}