feat(kubernetes): add core group with PVC + LoadBalancer Service [FIX-331] - #78
Merged
liamcervante merged 1 commit intoJul 7, 2026
Conversation
…-331] Adds the Kubernetes core/v1 API group to the tree, holding the two cost-relevant non-workload kinds: * PersistentVolumeClaim — storage class + requested bytes + annotations. The backing StorageRequest is shared with StatefulSet volumeClaimTemplates (one volume per template per replica). * Service — only type: LoadBalancer, with its type, annotations and ports retained for load-balancer pricing. Both map to cloud spend provisioned outside the node pools, so pricing them does not double-count node-pool IaC. Wiring rides entirely on the existing reflective walker/converter; no shared-code changes needed.
liamcervante
force-pushed
the
fix-331-add-persistent-storage-and-load-balancer-resources
branch
from
July 6, 2026 14:29
f8ee3ab to
f65eda1
Compare
liamg
approved these changes
Jul 7, 2026
liamcervante
deleted the
fix-331-add-persistent-storage-and-load-balancer-resources
branch
July 7, 2026 13:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First PR of the FIX-331 stack (add persistent storage + load balancer resources to the Kubernetes plugin). This lands the tree representation in
go-proto; the parser and pricing changes follow ininfracost/parserandinfracost/providers.Adds a Kubernetes core/v1 API group alongside the existing
appsandbatchgroups, holding the two cost-relevant non-workload kinds:PersistentVolumeClaim— storage class + requested bytes (both price drivers, readable straight from the manifest) + annotations for cloud detection. The sizing lives in a sharedStorageRequesttype.StatefulSet.VolumeClaimTemplates—[]core.StorageRequest, since a StatefulSet provisions one volume per template per replica (cost = Σ templates × replicas). Kept on the StatefulSet rather than as standalone PVCs so the replica multiplier isn't lost.Service— onlytype: LoadBalancer(the parser won't surface free ClusterIP/NodePort services); carriestype, annotations (LB flavour + cloud signals) and ports.Why a new group rather than extending workloads
PVCs and LoadBalancer Services aren't workloads (no containers/replicas), and — unlike per-workload compute — they map to discrete cloud resources (EBS/PD/Azure disk, ALB/NLB) provisioned outside the node pools. So pricing them is genuinely additive and doesn't double-count node-pool IaC.
Implementation notes
collectResources) and proto converter (convert.go) — no shared-code changes. New structs embeddingresource.Resourceare auto-discovered; the embeddedStorageRequestis flattened the same wayworkload.Workloadis.Testing
TestKubernetesRoundTripto cover a standalone PVC (embedded-field flattening + tags + annotations), a LoadBalancer Service (type/annotations/ports), and StatefulSetvolumeClaimTemplates.go build ./...,go vet, fullgo test ./..., andgolangci-lint runall pass.Technical docs