agentleFS
NVIDIAKnown publisherNVIDIA/k8s-device-plugin/AGENTS.md

k8s-device-plugin

AGENTS.md3.9k starsChanged 3 months agoApache-2.0View on GitHub

Guidance for AI coding agents working in this repository. Human contributors should also read CONTRIBUTING.md. The NVIDIA device plugin for Kubernetes is a DaemonSet that advertises NVIDIA GPUs to the kubelet through the Kubernetes device plugin framework, so that the kubelet can allocate those GPUs to containers. It also tracks GPU health. As of v0.15.0 this repository additionally holds the implementation of GPU Feature Discovery (GFD), which labels nodes with GPU properties. The repository builds four binaries, each with its…

Trending

Quiet since July.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 3 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the NVIDIA/k8s-device-plugin repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about NVIDIA/k8s-device-plugin

The biggest 5 of 16 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 16

Talked about on GitHub and Bluesky (16 times).

On GitHub · 14

9 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

15 rules. About 1 is common, 5 are distinctive, and 9 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    All standard tasks go through the Makefile.

    line 47
  2. Very specific:

    Always run make fmt, make check, and make test before considering Go changes complete.

    line 69
  3. Very specific:

    After changing a dependency, run make check-modules and make check-third-party-notices, then commit the regenerated vendor/ tree and …

    line 71
  4. Very specific:

    After changing an interface that carries a //go:generate moq directive, run make generate and commit the regenerated mock.

    line 73
  5. Very specific:

    Write idiomatic Go and follow the existing patterns in internal/ for logging, error wrapping, and NVML access rather than introducing new …

    line 78
  6. Distinctive:

    Keep changes scoped to the task.

    line 81
  7. Very specific:

    Every .go file should start with the Apache-2.0 boilerplate header.

    line 83
  8. Distinctive:

    When fixing a bug, add a regression test that fails without the fix.

    line 98
  9. Very specific:

    All commits must be signed off for DCO using git commit -s, which appends a Signed-off-by: Name <email> line.

    line 106
  10. Distinctive:

    Do not open, push to, or comment on GitHub issues or pull requests without explicit user confirmation.

    line 109
  11. Very specific:

    Keep pull request titles short and imperative.

    line 111
  12. Common:

    Never commit credentials, API keys, tokens, passwords, kubeconfigs, or private keys.

    line 117
  13. Distinctive:

    Never hand-edit a generated file.

    line 118
  14. Very specific:

    Never commit built binaries, coverage.out, or anything that .gitignore already excludes.

    line 119
  15. Very specific:

    Never modify GOVERNANCE.md or CODE_OF_CONDUCT.md unless the task is explicitly about those files.

    line 121

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Guidance for AI coding agents working in this repository. Human contributors should also read CONTRIBUTING.md.

Project Summary

The NVIDIA device plugin for Kubernetes is a DaemonSet that advertises NVIDIA GPUs to the kubelet through the Kubernetes device plugin framework, so that the kubelet can allocate those GPUs to containers. It also tracks GPU health. As of v0.15.0 this repository additionally holds the implementation of GPU Feature Discovery (GFD), which labels nodes with GPU properties.

The repository builds four binaries, each with its own entrypoint under cmd/:

  • nvidia-device-plugin is the device plugin itself.
  • gpu-feature-discovery is the GFD node labeler, which can be deployed alongside the plugin or on its own.
  • mps-control-daemon is the control daemon for CUDA MPS-based GPU sharing.
  • config-manager applies the per-node configuration selected by a node label.

The Go module is github.com/NVIDIA/k8s-device-plugin and the configuration API types live in api/config/v1.

Repository layout

  • api/config/v1/ holds the plugin configuration API types, covering sharing, MIG, IMEX, and flags.
  • cmd/ holds one directory per binary, as listed under Project Summary.
  • internal/ holds the supporting packages. The most important are internal/rm (resource managers for full GPUs and MIG devices), internal/plugin (the device plugin server), internal/lm (label management for GFD), internal/cdi (Container Device Interface spec generation), internal/vgpu (vGPU detection), and internal/resource (device discovery through NVML, sysfs, and CUDA).
  • deployments/helm/ holds the Helm chart for the plugin and GFD.
  • deployments/container/ holds the Dockerfile for the plugin image.
  • deployments/devel/ holds the pinned development toolchain used by make.
  • docs/ holds additional documentation, including docs/cdi.md and docs/gpu-feature-discovery/.
  • tests/ holds the end-to-end and Helm test suites and is a separate Go module.
  • testdata/ holds fixtures used by the end-to-end tests.
  • hack/ holds the development and release scripts for the changelog, third-party notices, and release preparation.
  • demo/ holds scripts that build and run a kind-based demo cluster.

Build, test, and lint

All standard tasks go through the Makefile. Prefer make targets over invoking tools directly so that CI and local runs stay consistent.

  • make build compiles every package in the module, and make cmds builds each binary under cmd/.
  • make test runs the unit tests over cmd/..., internal/..., and api/... with coverage.
  • make check runs the full check suite, which at present contains only make lint.
  • make lint runs golangci-lint run ./... using the configuration in .golangci.yml.
  • make fmt applies gofmt -s to the codebase and writes the files in place.
  • make goimports runs goimports -local github.com/NVIDIA/k8s-device-plugin and writes the files in place.
  • make generate runs go generate ./..., which regenerates the moq mocks.
  • make check-modules tidies, verifies, and vendors every module, then fails if go.mod, go.sum, or vendor/ turn out to be stale. CI runs the same check.
  • make third-party-notices regenerates THIRD_PARTY_NOTICES.md and make check-third-party-notices fails if that file is out of date. CI runs the same check.
  • make coverage runs the unit tests and then prints a per-function coverage report that excludes mocks.
  • make test-e2e runs a Ginkgo suite that requires a live Kubernetes cluster with real GPUs. Do not report it as passing when it was not run.
  • make test-helm renders the Helm chart templates and asserts on the result. It needs no cluster.

Always run make fmt, make check, and make test before considering Go changes complete.

After changing a dependency, run make check-modules and make check-third-party-notices, then commit the regenerated vendor/ tree and THIRD_PARTY_NOTICES.md alongside the source change. After changing an interface that carries a //go:generate moq directive, run make generate and commit the regenerated mock.

Coding Conventions

  • Write idiomatic Go and follow the existing patterns in internal/ for logging, error wrapping, and NVML access rather than introducing new libraries.
  • Comments explain why, not what. Identifier names should carry the what.
  • Keep changes scoped to the task. Avoid drive-by refactors, speculative abstractions, and unrelated formatting churn, and keep each pull request to one concern.
  • Every .go file should start with the Apache-2.0 boilerplate header. Match the header in neighboring files exactly rather than inventing a variant.
  • The vendor/ directory is checked in. Run go mod tidy and go mod vendor after any dependency change and never hand-edit vendored code.
  • The *_mock.go files are generated by moq from //go:generate directives, so regenerate them with make generate rather than editing them by hand.

Testing Conventions

  • Unit tests live in co-located *_test.go files and use testify through require and assert. Most of them group cases as subtests with t.Run. Run them with make test. Add tests that cover new behavior.
  • The end-to-end tests under tests/e2e use Ginkgo and Gomega and live in a separate Go module. They need a real cluster with GPUs, so treat them as unavailable unless that environment is present. The Helm tests under tests/helm are plain Go tests and need no cluster.
  • When fixing a bug, add a regression test that fails without the fix.

Contribution process (see CONTRIBUTING.md)

  • Any significant change needs an issue describing the problem or proposal before implementation begins. This covers architectural changes, new features, breaking changes to API or behavior, and non-trivial bug fixes. Check for a linked issue, or ask for one, rather than assuming a pull request on its own is sufficient.
  • All commits must be signed off for DCO using git commit -s, which appends a Signed-off-by: Name <email> line. DCO is a required status check. Never fabricate a sign-off identity. Use the configured git user's identity.
  • Do not open, push to, or comment on GitHub issues or pull requests without explicit user confirmation.
  • Keep pull request titles short and imperative. Fill in the sections in .github/PULL_REQUEST_TEMPLATE.md and explain the motivation rather than restating the diff.

Things to avoid

  • Never commit credentials, API keys, tokens, passwords, kubeconfigs, or private keys.
  • Never hand-edit a generated file. Regenerate it instead, as described under Coding Conventions.
  • Never commit built binaries, coverage.out, or anything that .gitignore already excludes.
  • Never modify GOVERNANCE.md or CODE_OF_CONDUCT.md unless the task is explicitly about those files.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.