Add deployment schema#1
Open
cpmores wants to merge 2 commits into
Open
Conversation
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.
Title: Add Deployments as a queryable resource type
Body
Adds Kubernetes Deployments as the fifth resource type that kq can
load and query, alongside pods, nodes, namespaces, and daemon_sets.
What this does
Users can now include a
"deployments"array in their snapshot JSONand query it via the
deploymentsSQL view:How I tested
Unit tests across all affected crates
bazel test -c opt //kq:kq_lib_test \ //kq/loader:loader_test \ //kq/query:query_test \ //kq/schema:schema_test \ //kq/synthetic:synthetic_test \ //kq/tests:synthetic_snapshot_testsEnd-to-end: generate a synthetic snapshot with deployments and query it
bazel run -c opt //kq/tools:synthetic_snapshot -- \ --output /tmp/kq-deployments --cluster demo --nodes 10 --overwrite bazel-bin/kq/kq /tmp/kq-deployments \ --query "SELECT metadata.name, spec.replicas, status.readyReplicas FROM deployments"Verify all five views are registered
bazel-bin/kq/kq /tmp/kq-deployments --query ".tables"Note
Medium Risk
New public SQL view and snapshot field extend the documented contract; changes are additive and mirror existing daemon_set patterns with broad test coverage.
Overview
Adds Kubernetes Deployments as a fifth loadable, SQL-queryable resource alongside pods, nodes, namespaces, and daemon sets.
Snapshots can include a
"deployments"array (ordeployments.ndjson.gz/ Arrow / Parquet artifacts). The loader registers the resource viaRESOURCE_TABLES, adds a ConvertingDeployments loading phase, and exposes thedeploymentsDataFusion view. Schema work adds k8s-openapiDeploymenttypes onClusterSnapshot, flat and nested Arrow schemas (metadata, spec including template containers, status,ready_percentage), plus a golden JSON fixture and synthetic generator output for ten sample workloads.Tests and docs expectations are updated so
deploymentsis part of the pinned user-facing view set.Reviewed by Cursor Bugbot for commit a5993ab. Bugbot is set up for automated code reviews on this repo. Configure here.