Repository navigation
Add k8s-pods app: pod table with namespace filter and pod deletion - #10
Merged
Merged
Conversation
Co-authored-by: setnilson <110850377+setnilson@users.noreply.github.com>
|
Bits Code status: ✅ Done |
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
Adds a new Datadog app,
apps/k8s-pods, that lists Kubernetes pods in a table with name, namespace, status, restarts, and age, and supports filtering by namespace and deleting unhealthy pods.tableQueryagainst the containers dataset with a fixed SQL template, capped at 500 rows) with a natural-languagequeryInventoryfallback if the fixed SQL does not match the org's schema. Rows are normalized and deduplicated per pod in the backend function (listPods.backend.ts).src/App.tsx).deletePod.backend.ts) that issues a DELETE against the Kubernetes API server via the generic HTTP action from@datadog/action-catalog/http/http. The action'sconnectionIdmust be a static top-level constant (enforced by the Datadog vite plugin), so it is configured via thekubeAPIConnectionIdconstant; no credentials are handled in app code, and pod/namespace names are strictly validated before use.kube_pod_name,kube_namespace,kube_pod_status_phase,kube_container_status_restarts_total,started_at) could not be probed from this sandbox; if the query errors in your org, the app automatically falls back to the natural-language inventory query, and the SQL constant can be adjusted in one place.Changes
apps/k8s-pods(vite-react template) with unique app identifier indatadog-app.config.json/vite.config.ts.src/listPods.backend.ts: fixed DDSQL query + NL fallback, pod normalization/dedup, clamped limit.src/deletePod.backend.ts: Kubernetes pod deletion via the generic HTTP action, input validation, static connection ID configuration.src/App.tsx: pods table (DRUIDS Table, Badge for status), namespace filter, delete action for unhealthy pods, API-server URL setting.react/react-domwith the root overrides (^18.3.1) per the workspace dependency rules.package-lock.jsonand committed it together with the new app.Testing
npm run typecheck -w apps/k8s-podspasses.npm run lint -w apps/k8s-podspasses with zero warnings.npm run build -w apps/k8s-podsbuilds successfully (requiresDD_SITEto be unset locally because an emptyDD_SITEenv value is rejected by the vite plugin; CI is unaffected).origin/master(fe1e996), regeneratedpackage-lock.jsonwithnpm install --package-lock-only --ignore-scripts, validated withnpm ci --ignore-scripts, and confirmed both theapps/k8s-podsrecord andnode_modules/k8s-podsworkspace link are present.PR by Bits - View session in Datadog