Conversation
…DB, MSSQL, Spanner, Aerospike, OCI and AlicloudOSS storage backends to VaultServer OpenBao recently restored (or is in the process of restoring) all of these physical storage backends. VaultServer's BackendStorageSpec only covered a subset of what OpenBao/Vault actually support (inmem, etcd, gcs, s3, azure, postgresql, mysql, file, dynamodb, swift, consul, raft). This adds the remaining supported backends as new optional pointer fields, following the existing field/spec shape conventions (SecretRef for credentials, DatabaseRef for KubeDB-managed databases where applicable, HAEnabled/HATable string pairs for the backends that support HA). FoundationDB is intentionally excluded: it requires CGo and the native libfdb_c client library, so it isn't compiled into standard OpenBao/Vault images and can't be assumed available in a generic VaultServer deployment (documented in a comment on BackendStorageSpec). Scope note: these 9 new backends are added to v1alpha2 (the storage/hub version, and the only one the operator's pkg/vault/storage package actually consumes) but not mirrored into v1alpha1. v1alpha1's existing backend specs (PostgreSQLSpec, MySQLSpec, ...) predate several v1alpha2-only conventions (SecretRef-typed credentials instead of bare secret-name strings, DatabaseRef, HAEnabled) that the new types also use, so a 1:1 mirror isn't mechanical here the way it was for e.g. Swift/Consul/Raft -- it would need bespoke field-mapping conversion functions per backend. Left as a documented follow-up (Convert_v1alpha1_<X>Spec_To_v1alpha2_<X>Spec, following the existing pattern in apis/kubevault/v1alpha1/conversion.go) rather than done half-carefully here. Generated with locally-installed deepcopy-gen/controller-gen (v0.33.5/v0.16.5, matching the versions vendored in this repo's ghcr.io/appscode/gengo:release-1.32 codegen image closely enough to verify byte-for-byte parity against the already-committed generated files before regenerating for real), plus the same kubectl patch/label post-processing 'make patch-crds'/'make label-crds' apply. The CRD diff is purely additive against the committed crds/kubevault.com_vaultservers.yaml. openapi_generated.go was not regenerated (its dockerized openapi-gen + hack/gencrd/main.go pipeline wasn't reproduced locally); this only affects generated OpenAPI/swagger schema docs, not runtime behavior. Signed-off-by: Tamal Saha <tamal@appscode.com>
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
OpenBao recently restored (or is in the process of restoring) a number of physical storage backends that had been removed upstream: CockroachDB, Cassandra, ZooKeeper, CouchDB, MSSQL, Google Cloud Spanner, Aerospike, OCI Object Storage, and Alicloud OSS.
VaultServer.spec.backend(BackendStorageSpec) only covered a subset of what OpenBao/Vault actually support (inmem, etcd, gcs, s3, azure, postgresql, mysql, file, dynamodb, swift, consul, raft) — this PR adds the remaining 9 as new optional fields.Each new spec type follows the existing conventions:
*core.LocalObjectReferencecredentialSecretReffor credentials,DatabaseReffor KubeDB-managed databases where the backend is DB-connection-based (CockroachDB),haEnabled/haTablestring pairs for the backends that support HA (CockroachDB, Spanner, and — already supported — OCI in the operator's future validation logic), andtlsSecretReffor backends needing a TLS client cert (Cassandra, ZooKeeper).FoundationDB is intentionally excluded — it requires CGo and the native
libfdb_cclient library, so it isn't compiled into standard OpenBao/Vault images and can't be assumed available in a genericVaultServerdeployment. Documented in a comment onBackendStorageSpec.Scope note: v1alpha2-only, not mirrored to v1alpha1
These 9 backends are added to v1alpha2 (the storage/hub version,
+kubebuilder:storageversion, and the only version the operator'spkg/vault/storagepackage actually consumes) but not mirrored into v1alpha1. v1alpha1's existing backend spec types (PostgreSQLSpec,MySQLSpec, ...) predate several v1alpha2-only conventions the new types also use (SecretRef-typed credentials instead of bare secret-name strings,DatabaseRef,HAEnabled) — a 1:1 mirror isn't mechanical here the way it was for e.g. Swift/Consul/Raft, it would need bespoke field-mappingConvert_v1alpha1_<X>Spec_To_v1alpha2_<X>Specfunctions per backend (see the existing pattern inapis/kubevault/v1alpha1/conversion.go). Left as a documented, deliberate follow-up rather than done half-carefully in this PR.Codegen
Regenerated
zz_generated.deepcopy.goandcrds/kubevault.com_vaultservers.yamlwith locally-installeddeepcopy-gen/controller-gen(v0.33.5/v0.16.5respectively — not the repo'sghcr.io/appscode/gengo:release-1.32Docker image, which wasn't practical to pull in my environment). Before making any changes, I ran both tools against the unmodified tree and confirmed byte-for-byte (deepcopy) / near-byte-for-byte (CRD, modulo acontroller-gen.kubebuilder.io/versionannotation this repo's pipeline apparently strips) parity with what's already committed, then applied the samekubectl patch/kubectl labelpost-processingmake patch-crds/make label-crdsdo. The CRD diff is purely additive (616 lines, all+) against the committed file.openapi_generated.gowas not regenerated — its pipeline (dockerizedopenapi-gen+hack/gencrd/main.go) wasn't reproduced locally. This only affects generated OpenAPI/swagger schema docs, not runtime behavior; happy to follow up if that's needed before merge.Companion PRs
pkg/vault/storage's factory + theVaultServervalidating webhook (depends on this PR being merged/tagged first, or areplacedirective during review).