Skip to content

KPEP-0001: Pluggable storage backends#1

Open
zachsmith1 wants to merge 4 commits into
mainfrom
kpep-0001-pluggable-storage-backends
Open

KPEP-0001: Pluggable storage backends#1
zachsmith1 wants to merge 4 commits into
mainfrom
kpep-0001-pluggable-storage-backends

Conversation

@zachsmith1

@zachsmith1 zachsmith1 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Proposes an instance-scoped registry above the upstream storagebackend/factory.Create switch, so non-etcd backends slot into the apiserver without fork modification or per-backend if/else in cmd/apiserver/app/config.go.
  • CLI surface mirrors upstream: --storage-backend=<name> (already an upstream flag, currently restricted to etcd3) selects the backend; each backend brings its own --<name>-* flag block the way --etcd-* belongs to etcd.
  • Etcd is a registered backend (backends/etcd/), not a special case. Spanner migrates into backends/spanner/ as the first non-etcd backend; --spanner-* flags stay canonical.
  • Conformance suite extends k8s.io/apiserver/pkg/storage/testing rather than reimplementing it.

Why this shape

  • Modifying the fork to make factory.Create pluggable 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."
  • A YAML config file (mirroring --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.

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.
@zachsmith1 zachsmith1 marked this pull request as draft June 3, 2026 02:37
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant