KPEP-0001: Pluggable storage backends#1
Open
zachsmith1 wants to merge 4 commits into
Open
Conversation
Proposes a pattern for plugging non-etcd storage backends into the kplane apiserver: an instance-scoped registry above the upstream storagebackend.factory.Create switch, per-backend CLI flag blocks (matching how --etcd-* belongs to etcd), and a conformance suite that extends k8s.io/apiserver/pkg/storage/testing. Etcd becomes a registered backend like any other; Spanner migrates into kplane-dev/storage/backends/spanner/ as the first non-etcd backend. The fork is not modified.
…EtcdOptions The etcd backend no longer rebinds --etcd-* flags. Upstream's EtcdOptions is already in the apiserver's options chain and owns every --etcd-* flag, the --storage-backend discriminator, and the cross-cutting storage flags (--storage-media-type, --watch-cache, --encryption-provider-config, etc.). The wrapper takes a *EtcdOptions at construction and reads StorageConfig at Build time. Resolves both prior Open Questions: cross-cutting flags stay where they are, etcd wrapper's AddFlags is a no-op.
- Fork stats: 2 commits across 17 file modifications (was: 2 commits, 15 files). - Soften upstream-community claims. #1957 closed; #172 marked in-development with no recent motion; SIG API Machinery's 'use kine' position is de facto, not formally stated. No verifiable steering-committee decision to 'go all-in on etcd3.' - Conformance suite: k8s.io/apiserver/pkg/storage/testing lives in the fork's staging tree (not vendored into the apiserver). Functions are RunTestCreate, RunTestGet, RunTestList, RunTestGuaranteedUpdate, RunTestStats, etc., called from backends' own Test* functions. Sourced via go.mod replace. - runtime.Scheme-config cost adjusted to ~17 files / ~500 LOC (was: 10 / 700).
This was referenced Jun 16, 2026
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
storagebackend/factory.Createswitch, so non-etcd backends slot into the apiserver without fork modification or per-backendif/elseincmd/apiserver/app/config.go.--storage-backend=<name>(already an upstream flag, currently restricted toetcd3) selects the backend; each backend brings its own--<name>-*flag block the way--etcd-*belongs to etcd.backends/etcd/), not a special case. Spanner migrates intobackends/spanner/as the first non-etcd backend;--spanner-*flags stay canonical.k8s.io/apiserver/pkg/storage/testingrather than reimplementing it.Why this shape
factory.Createpluggable was considered and rejected: Pluggable storage backends (was Support for Consul K/V storage) kubernetes/kubernetes#1957 closed the door on pluggable storage upstream years ago, and our fork is intentionally minimal (2 commits, 15 files). See "Alternative A."--encryption-provider-config) was considered and rejected: upstream doesn't use one for storage, and CLI flags keep parity with--etcd-*. See "Alternative B."runtime.Scheme-versioned config per backend was considered and rejected: ~700 LOC and 10 files per backend, only worth it for durable user-facing APIs. See "Alternative C."Status
Provisional. Filed against the new KPEP process; discussion happens in this PR.