Skip to content

Add exec connection options to remaining kubedb resource descriptors - #663

Merged
ArnobKumarSaha merged 1 commit into
masterfrom
arnob-db-exec
Aug 6, 2026
Merged

Add exec connection options to remaining kubedb resource descriptors#663
ArnobKumarSaha merged 1 commit into
masterfrom
arnob-db-exec

Conversation

@ArnobKumarSaha

Copy link
Copy Markdown
Member

Adds spec.exec to 26 kubedb ResourceDescriptors, following the shape already used by mongodbs/postgreses/mysqls, so the UI can open an authenticated shell into the primary container.

Every kubedb RD now has spec.exec except etcds (see below).

How the values were derived

  • Container name*ContainerName constants in kubedb.dev/apimachinery/apis/kubedb/constants.go. Verified for all 26.
  • Auth env vars — same constants file, or each operator's petset builder.
  • serviceNameTemplate — uniformly {{- .metadata.name -}}; every DB's ServiceName() resolves to OffshootName().

Notes

  • HTTP-only DBs (druid, milvus, qdrant, solr, weaviate) drop into bash with a curl one-liner in help, matching the existing elasticsearch pattern.
  • neo4j reads credentials from the mounted /config/neo4j-auth/{username,password} files rather than env — NEO4J_USERNAME/NEO4J_PASSWORD are exported only inside the startup script (neo4j/pkg/controller/config.go:334-335), so they are not present in a fresh exec shell.
  • aerospike's container sets no env vars at all (aerospike/pkg/controller/petset.go:149-156), so asadm runs bare.
  • mssql prepends both /opt/mssql-tools18/bin and /opt/mssql-tools/bin to PATH, because the sqlcmd location depends on whether the version is >= 2022-cu14 (mssqlserver/pkg/controller/petset.go:507-511).
  • etcd is excluded — there is no etcd operator repo under kubedb.dev/ and no EtcdContainerName constant, so the container name could not be verified.

Worth a reviewer's eye

Container names and env vars are grep-verified. The CLI binary names are not for a subset — these follow upstream convention rather than anything in the operator code: cqlsh, clickhouse-client, hdbsql, zkCli.sh, kafka-topics.sh, hz-cli, control.sh, asadm, and psql for pgbouncer/pgpool. Operator code did confirm memsql, rabbitmqctl, sqlplus, sqlcmd, db2, and psql (documentdb).

Testing

  • go build ./... passes
  • cmd/resource-fmt produces no further changes
  • cmd/check-edge-label and cmd/check-embed pass
  • cmd/check-schema fails, but fails identically on clean master and is not wired into the fmt or ci targets

Unrelated observations

  • cmd/gen-resourcedescritors builds a fresh ResourceDescriptor with only Spec.Resource set and os.WriteFiles over the target without reading it (main.go:95-129), so re-running it would wipe spec.exec from every DB — including the ones that already had it before this PR.
  • v1/memcacheds.yaml has a pre-existing exec entry with no container and no help. Left untouched.

Adds spec.exec to 26 kubedb ResourceDescriptors, following the shape
already used by mongodbs/postgreses/mysqls, so the UI can open an
authenticated shell into the primary container.

Container names come from apimachinery's *ContainerName constants; auth
env vars from the same constants file or each operator's petset builder.

Notes:
- HTTP-only DBs (druid, milvus, qdrant, solr, weaviate) drop into bash
  with a curl one-liner in help, matching the elasticsearch pattern.
- neo4j reads credentials from the mounted /config/neo4j-auth files
  rather than env, since NEO4J_USERNAME/PASSWORD are exported only
  inside the startup script.
- aerospike's container sets no env vars, so asadm runs bare.
- mssql prepends both mssql-tools paths to PATH because the sqlcmd
  location depends on the server version.
- etcd is left out: it has no operator repo or container name constant.

Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
@ArnobKumarSaha
ArnobKumarSaha merged commit 7ae95b5 into master Aug 6, 2026
7 checks passed
@ArnobKumarSaha
ArnobKumarSaha deleted the arnob-db-exec branch August 6, 2026 05:15
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