karpenter-provider-azure
Copilot instructions556 starsChanged 4 months agoApache-2.0View on GitHub
This repository is the Azure cloud provider for Karpenter. It provisions real Azure infrastructure for AKS clusters, so defects surface as failed node provisioning, stranded Azure resources, or unschedulable workloads. Read AGENTS.md for the architecture, provisioning modes, code layout, validation commands, and the full pull request review guidelines. This file is the short form; AGENTS.md is the source of truth. Review for correctness, security, and backward compatibility, in that order. Focus on architecture, logic bugs, and failure modes. Reason about…
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- run-e2e-testsSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
Read AGENTS.md for the architecture, provisioning modes, code layout, validation commands, and the full pull request review guidelines.
- Very specific: line 66
Only comment when you have a substantive finding.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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.
Files
Copilot Instructions
This repository is the Azure cloud provider for Karpenter. It provisions real Azure infrastructure for AKS clusters, so defects surface as failed node provisioning, stranded Azure resources, or unschedulable workloads.
Read AGENTS.md for the architecture, provisioning modes, code layout, validation
commands, and the full pull request review guidelines. This file is the short form; AGENTS.md is
the source of truth.
Priorities
Review for correctness, security, and backward compatibility, in that order. Focus on architecture, logic bugs, and failure modes. Reason about the change's intent and its dependencies rather than pattern matching.
Always Consider
- Provisioning modes — the provider has separate VM-based and AKS Machine API-based
implementations in
pkg/providers/instance/. Determine which modes a change affects and whether the counterpart implementation needs the same change. Files withATTENTION!!!comments mark exactly where a one-sided change silently breaks a mode. The two AKS Machine API modes (aksmachineapiandaksmachineapiheaderbatch) are the same provisioning path and differ only in how creates are dispatched, so a Machine API behavior change normally applies to both; batch concerns are grouping, per-machine header fields, batch limits, and partial failure. - Deployment models — the same code runs as the AKS-managed addon (NAP) and as a self-hosted deployment. Do not assume configuration, defaults, or AKS-managed behavior that only holds for one of them.
- Backward compatibility — existing clusters upgrade in place.
AKSNodeClassfields, node labels, Helm values, and defaults must keep working for objects that already exist. - API versions —
v1beta1is the currentAKSNodeClassversion.v1alpha2is deprecated and planned for removal, so new fields and behavior belong inv1beta1; do not ask forv1alpha2changes purely for parity. Spec changes usually affect defaulting, CEL validation, the nodeclass hash, drift, and the generated CRDs. - Generated files —
zz_generated.deepcopy.go, CRD YAML, andcharts/karpenter-crd/templatesare produced bymake verify. Flag hand-edited generated output. - Azure API semantics — retries, throttling, pagination, long-running operation polling, cancellation, nil SDK pointers, concurrency control, and eventual consistency. Never assume a resource is readable right after it is created.
- Cleanup and idempotency — every created Azure resource needs a cleanup path, including on partial failure. Reconcile paths are retried and must be safe to run repeatedly. "Not found" during deletion or garbage collection is success, not an error.
- Security — no credentials, tokens, or customer identifiers in logs, events, conditions, or
resource tags. No unvalidated user input flowing into Azure resource names, shell commands, or
Kubernetes objects. Actions pinned to a full commit SHA, and new external endpoints added to the
harden-runnerallowed-endpointslist. - Public repository hygiene — flag references in code, comments, docs, commit messages, or PR descriptions to systems that external contributors cannot access. Contributions must be reviewable from public sources alone.
- Test coverage and consistency — ask whether the tests would fail if this behavior regressed.
Failure, retry, and cleanup paths need coverage too, not just the success path. Also check the
new tests against the existing tests for each edited file: they should extend the established
_test.gofile or package suite rather than start a parallel one, and should match its setup, fakes, table structure, naming, and assertion style, covering the same provisioning modes and deployment models the neighboring cases cover. A newtest/suites/directory must be added to.github/workflows/e2e-matrix.yaml. Helm chart snapshots verify template rendering only, not runtime behavior.
Output
Comment inline on the specific line, and state the concrete scenario in which the code misbehaves
plus a specific fix or verification step. Label each finding with a severity (High, Medium,
Low) and a category (Correctness, Compatibility, Azure API, Lifecycle, Scheduling,
Security, Performance, Test Coverage).
Only comment when you have a substantive finding. Do not restate lint, formatting, or anything
make verify and CI already enforce.
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
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.

