kubetail / crates
CLAUDE.md1.8k starsChanged 7 days agoApache-2.0View on GitHub
A Cargo workspace of three crates: cluster_agent (the Cluster Agent, a gRPC server on each node that lists, watches and streams that node's container log files), rgkl (the log file reader it links) and types (the tonic/prost code generated from proto/cluster_agent.proto; nothing hand-written). CI tests and builds on Linux alone. To run a local agent under Tilt, set KUBETAIL_RUST_DEV_MODE to docker or local; without it Tilt pulls the published image and your changes to crates/ are not deployed. Runs as…
Trending
Less talk lately.about the whole repository
Who's talking about kubetail-org/kubetail
- A Hacker News story“Show HN: Kubetail – Real-time log search for Kubernetes”Hacker News · May 1, 2025 · 126 points
- A Hacker News story“Show HN: Kubetail – Web-based real-time log viewer for Kubernetes”Hacker News · Feb 13, 2024 · 70 points
- @damyr.fr“Sur Kube tu as github.com/kubetail-org..., mais le graph d'event manque faut avouer”Bluesky · May 26, 2025 · 4 likes
- @matsuu.bsky.social“k8sのログをブラウザ経由で参照できるダッシュボード実装。pod単位のほか、deploymentやdaemonsetの単位で複数Podのログをまとめてのリアルタイム表示もできる。正規表現による絞り込みも可。”Bluesky · May 4, 2025 · 4 likes
- @chrisshort.net“kubetail-org/kubetail: Real-time logging dashboard for Kubernetes. View logs in a terminal or a browser. …”Bluesky · May 22, 2026 · 1 likes
The biggest 5 of 27 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 27
Talked about on GitHub, Bluesky and Hacker News (27 times).
On GitHub · 20
- Oct 24, 2025🐋 Release kubetail-0.15.4 — kubetail-org/helm-charts1 reaction
- Oct 22, 2026chore(deps): update kubetail to v0.18.1 — uniget-org/tools0 reactions · 2 comments
- Jul 13, 2026💎 Knowledge Update & Optimization: 13 Jul 2026 — nubenetes/awesome-kubernetes0 reactions · 40 comments
- Jul 12, 2026💎 Knowledge Update & Optimization: 12 Jul 2026 — nubenetes/awesome-kubernetes0 reactions · 40 comments
- Jul 12, 2026💎 Knowledge Update & Optimization: 12 Jul 2026 — nubenetes/awesome-kubernetes0 reactions · 40 comments
15 more on GitHub
- Jun 25, 2026x/vulndb: potential Go vuln in github.com/kubetail-org/kubetail/modules/cli: GHSA-v8j7-hp7c-738f — golang/vulndb0 reactions · 1 comment
- Feb 5, 2026feat(kubetail): add package — brioche-dev/brioche-packages0 reactions
- Dec 8, 2025add kubetail — ai-solution-eng/frameworks0 reactions
- Oct 4, 2025feat: add kubetail plugin — asdf-vm/asdf-plugins0 reactions
- Sep 28, 2025Add kubetail plugin — kubernetes-sigs/krew-index0 reactions · 8 comments
- Sep 26, 2025new naming conflict with a project — johanhaleby/kubetail0 reactions · 2 comments
- Sep 19, 2025dev-util/kubetail-bin: add 0.7.5, 0.8.2 — gentoo/gentoo0 reactions · 6 comments
- Sep 18, 2025[Request]: kubetail — ScoopInstaller/Main0 reactions · 1 comment
- Jul 11, 2025🎣 Patch release — kubetail-org/helm-charts0 reactions
- Jul 9, 2025Add Real-Time Log Streaming with Kubetail — kubestellar/ui0 reactions · 5 comments
- Jun 21, 2025TypeScript definitions missing in v8 — nmn/react-timeago0 reactions · 1 comment
- May 21, 2025kubetail-org/kubetail: 一个通用的 Kubernetes 日志仪表板,可以暴漏在浏览器当中查看。 — awesome-ops/awesome-ops.github.io0 reactions
- May 20, 2025Integrate Kubetail graphical Logs for pods and jobs into Kubestellar — kubestellar/ui0 reactions · 9 comments
- May 2, 2025Vendoring a package using "local" imports from another directory? — openSUSE/obs-service-go_modules0 reactions
- Feb 2, 2025new addon: kubetail — kubernetes/minikube0 reactions · 26 comments
On Bluesky · 5
- May 26, 2025Sur Kube tu as github.com/kubetail-org..., mais le graph d'event manque faut avouer — @damyr.fr4 likes and reposts · 1 reply
- May 4, 2025k8sのログをブラウザ経由で参照できるダッシュボード実装。pod単位のほか、deploymentやdaemonsetの単位で複数Podのログをまとめてのリアルタイム表示もできる。正規表現による絞り込みも可。 — @matsuu.bsky.social4 likes and reposts
- May 22, 2026kubetail-org/kubetail: Real-time logging dashboard for Kubernetes. View logs in a terminal or a browser. Run anywhere - desktop, cluster,… — @chrisshort.net1 likes and repost
- May 1, 2025Show HN: Kubetail – Real-time log search for Kubernetes Hi Everyone! Kubetail is a general-purp... https://github.com/kubetail-org/kubetail… — @kubernetes.activitypub.awakari.com.ap.brid.gy1 likes and repost
- Feb 13, 2024Show HN: Kubetail – Web-based real-time log viewer for Kubernetes Discussion — @hn100.bsky.social1 likes and repost
On Hacker News · 2
- May 1, 2025Show HN: Kubetail – Real-time log search for Kubernetes126 points · 35 comments
- Feb 13, 2024Show HN: Kubetail – Web-based real-time log viewer for Kubernetes70 points · 33 comments
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- dashboard-ui/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- modules/CLAUDE.mdCLAUDE.md
- proto/CLAUDE.mdCLAUDE.md
- release-cliSkill
- release-clusterSkill
- release-notesSkill
- release-versionSkill
The file
Files
crates — Rust in-cluster components
A Cargo workspace of three crates: cluster_agent (the Cluster Agent, a gRPC server on each node that lists, watches and streams that node's container log files), rgkl (the log file reader it links) and types (the tonic/prost code generated from proto/cluster_agent.proto; nothing hand-written).
- Run cargo from
crates/, never from a crate's directory. From the repo root,make lint-rust,vet-rustandtest-rustdo. protocmust be onPATHfor any build, clippy or test.types/build.rscompiles the proto on every build; the output is never committed. Editing the proto:proto/CLAUDE.md.rust-toolchain.tomlpins the exact Rust version, which CI and the agent's Dockerfiles share (rootCLAUDE.md, Dependencies). A bump can add clippy lints that fail-D warningson code nobody touched; fix them in the same PR.
Checks
cd crates
cargo fmt --all # write; CI runs it with -- --check
cargo clippy --all --all-targets -- -D warnings
cargo test # every crate; `cargo test -p cluster_agent auth` for one crate, by nameCI tests and builds on Linux alone. To run a local agent under Tilt, set KUBETAIL_RUST_DEV_MODE to docker or local; without it Tilt pulls the published image and your changes to crates/ are not deployed.
cluster_agent
Runs as a DaemonSet with the node's /var/log mounted read-only. Only the Cluster API calls it. Unix only.
- Config (
config.rs):-c/--config <FILE>is required. Precedence is-p key:valueoverrides, then the file, then the defaults inbuilder_with_defaults, whichconfig/default/cluster-agent.yamldocuments. Keys are top-level and kebab-case.NODE_NAMEis read from the environment. - It does not start without a Kubernetes client config it can infer, in-cluster or a kubeconfig: the
Authorizerneeds one. - Authentication is
auth.rs, authorization isauthorizer.rs. - The health service reports serving from just before
serveuntil a signal arrives, then not serving while the server drains. A new service is listed inSERVICES(health.rs) so a check names it. - A log file is
<pod>_<namespace>_<container>-<container-id>.logundercontainer-logs-dir.log_records.rsbuilds that name from the request and canonicalizes it, which follows the/var/log/containerssymlink to the real file.
Security invariants
- The listener is mutual TLS, always.
configure_tlssets the server identity andclient_ca_rootwith no optional client auth. Everything below rests on it: weaken it and the identity headers are forgeable. - The agent never sees a Kubernetes token. It trusts the
x-remote-user,x-remote-groupandx-remote-extrasmetadata a peer sends, provided the peer's certificate chains totls.ca-fileand, whentls.allowed-namesis not empty, its CN is listed. An empty list accepts any certificate from the CA. The Go side that sets these headers ismodules/shared/grpchelpers; change the two together. - Every RPC authenticates, then authorizes, before it reads a log file or lists one. Each method calls
auth::identity_from(&request)?andauthorizer.is_authorized(&identity, &namespaces, "get"): aSubjectAccessReviewforgetonpods/logper namespace, or one cluster-wide review for an empty namespace list. A new method repeats both calls; a new service is wrapped inauth::interceptorinmain.rs.stream_forward_denies_before_file_lookupandstream_backward_denies_before_file_lookuppin the order. - The health and reflection services carry no interceptor. They sit behind mTLS alone. Nothing that returns log data goes on an unwrapped service.
Authorizercaches decisions for 30 seconds, denials included, keyed by identity, namespace and verb. A stream is authorized once, when it opens.- The pod, namespace, container and container id in a
LogRecordsStreamRequestare joined into a path unchecked. Onlynamespaceis authorized. Treat every one of them as attacker-controlled when changingget_log_filename.
rgkl
Two entry points, stream_forward and stream_backward, both called by cluster_agent/src/log_records.rs. Each sends Result<LogRecord, Status> on a tokio mpsc channel and returns (). An error travels in the channel, never as a return value.
- The format comes from the file name: Docker JSON when the path ends in
-json.log, else CRI. - A CRI line is split only in
util/cri.rs. The grep, the time search and the record writer all call it, so they agree on which lines exist and which are final. A line it rejects is dropped. - A grep matches the message alone, never the timestamp or stream, and is case-sensitive here; the Go side adds
(?i)(modules/shared/logs). Each space in the pattern becomes a pattern that also matches ANSI sequences. A regex the engine rejects reaches the caller asInvalidArgument. - Time bounds are a binary search over byte offsets (
util/offset.rs), which assumes timestamps ascend through the file. - Forward follows the file after the search unless
stop_timeis set orfollow_fromisNoop.FollowFrom::Endignores both time bounds. OnlyModifyevents are handled; a rotated file is not reopened. Backward never follows. - Sends block.
process_outputsends withtask::block_in_place(|| sender.blocking_send(..)), which panics on a current-thread runtime. A test in which a record is sent is#[tokio::test(flavor = "multi_thread")]. - A lost client is noticed on the next send. A failed send cancels the stream's token.
Conventions
- No
unwrapoutside tests. The workspace deniesclippy::unwrap_used, and a crate inherits it with[lints] workspace = true. A test module that callsunwrapopens with#![allow(clippy::unwrap_used)].expectis for what cannot fail at run time (a static regex, a required clap argument) and says so in its message. - Errors are a
thiserrorenum per area with one mapping totonic::Status:AuthErrorthroughauth_error_to_status,WatcherErrorandFsWatcherErrorthroughFrom<_> for Status. Add a variant and its mapping together. - Cancellation is
tokio_util'sCancellationToken. A signal cancels the root token and every stream holds a child. A loop selects onctx.cancelled(); a followed stream or a metadata watch cancelled by shutdown sendsUnavailablebefore it ends. Per-request work is spawned through theTaskTracker, never a baretokio::spawn, so shutdown waits for it. - Logging is
tracing:info!for lifecycle inmain.rs,debug!for nearly everything else. - Decisions are free functions, I/O is a thin shell around them.
authenticate,check,build_sarand theutil/offset.rssearches are tested without a server, a cluster or a watcher. Shape new logic the same way. - Module files are
foo.rsbeside afoo/directory incluster_agent. A service implementation is<Service>Impl.
Tests
- Tests are inline
#[cfg(test)]modules in the file they cover. There is notests/directory. - A test seam is a parameter, a generic or a field.
Authorizer::with_reviewertakes a fakeAccessReviewer.LogMetadataWatcher::watch::<T: Watcher>takes the watcher type, so a test passesPollWatcher.mint_cert(auth.rs) makes a certificate withrcgen. - No sleeps. A test that changes a file first awaits
LifecycleEvent::WatcherStartedon thelifecycle_txchannel, then awaits the event it expects under atokio::time::timeout.test_newly_created_file_receives_modify_events(log_metadata_watcher.rs) is the reference;test_follow_from(rgkl/src/stream_forward.rs) shows the signal for a followed stream. LogMetadataWatcher::newtakes the debounce. Tests pass a short one, and a negative assertion waits longer than it. Rename and modify tests are#[cfg(not(target_os = "macos"))].- Files go in
tempfile::tempdir()or aNamedTempFile.config.rstests are#[serial]. Table tests userstest.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

