Skip to content

event-exporter-rs (3/3): add streaming K8s WatchList, binary entrypoint, Dockerfile, and E2E tests - #1305

Draft
zxqlxy wants to merge 3 commits into
GoogleCloudPlatform:masterfrom
zxqlxy:event-exporter-rs-pr3
Draft

zxqlxy wants to merge 3 commits into
GoogleCloudPlatform:masterfrom
zxqlxy:event-exporter-rs-pr3

Conversation

@zxqlxy

@zxqlxy zxqlxy commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary (Part 3 of 3)

Completes event-exporter-rs with the streaming Kubernetes WatchList Pod reflector and 410 Gone-resilient Event watcher, the event-exporter binary entrypoint, multi-arch static musl container build onto gcr.io/distroless/static:latest, and live multi-shard subprocess E2E tests.

Review note: Stacked on #1303 and #1304. Until #1304 merges into master, review only the Part 3 commit (01e2385).

Included in Part 3

  • src/k8s_stream.rs: Streaming PartialObjectMetadata Pod reflector with explicit k8s.io/initial-events-end bookmark gating, automatic HTTP 422 paginated List fallback, Go "items": null empty-list handling, and line-by-line Event watcher with 410 Gone watermark recovery (zero DeltaFIFO payload retention).
  • src/main.rs, Dockerfile, Makefile: Multi-arch (linux/amd64, linux/arm64) statically linked musl build (rust:1-alpine +crt-static) onto gcr.io/distroless/static:latest (USER 65532:65532), wired into .github/workflows/ci.yaml (ci-container-build) and .github/dependabot.yaml (docker).
  • tests/: WatchList premature-EOF regression test, 422 fallback + 410 Gone recovery test, subprocess CLI + SIGTERM drain test, and 3-shard live subprocess OTLP + HTTP 429 backpressure benchmark (1,500/1,500 unique enriched events at 10.9-12.3 MiB RSS/shard).

Stack

  1. Part 1 (event-exporter-rs (1/3): add core crate, CLI/sharding, 24B PodOwnerTable, enricher, and metrics #1303): Core crate, CLI/sharding, PodOwnerTable, enricher, and metrics
  2. Part 2 (event-exporter-rs (2/3): add pure-Rust HTTP/gRPC transport, GKE auth, batch pipeline, and dual sinks #1304): Pure-Rust HTTP/gRPC transport, GKE auth, batch pipeline, and dual sinks
  3. Part 3 (event-exporter-rs (3/3): add streaming K8s WatchList, binary entrypoint, Dockerfile, and E2E tests #1305, this PR): Streaming K8s WatchList reflector + 410 Gone recovery, binary entrypoint, Dockerfile, and multi-shard E2E suite

…nricher, and metrics

Part 1 of 3 introducing `event-exporter-rs`, a `#![forbid(unsafe_code)]` pure-Rust
Kubernetes Event exporter for GKE:

- `src/cli.rs` & `src/shard.rs`: Drop-in parser for GKE single-dash Go flags
  (`-sink-opts`, `-universeDomain`, `-system-namespaces`, `-event-label-selector`)
  plus KEP-5866 `--shard-mode=server` and Jump Consistent Hash `--shard-mode=client`
  Pod/Event co-partitioning.
- `src/pod_cache.rs`: Lock-sharded open-addressed 24-byte/slot `PodOwnerTable`
  (`16B PodKey` + `8B CompactOwner`) resolving `Deployment`, `StatefulSet`,
  `DaemonSet`, `CronJob`, `Job`, and `JobSet` (`restart-attempt` + `jobset-uid`)
  owners while holding 1,000,000 active Pods in ~50.4 MiB RSS delta (~58.8 MiB
  total process RSS vs. >1.2 GiB in Go `client-go`).
- `src/enricher.rs` & `src/metrics.rs`: Cloud Logging `k8s_pod`/`k8s_node`/`k8s_cluster`
  routing, cross-namespace RBAC spoofing guard, `fieldBlacklist` filtering,
  Gregorian RFC3339 validation, and 100% LOrIS Prometheus metric compatibility.
- Formal state-machine refinement, sharding bijection, and 1,000,000-pod memory
  benchmark suites, wired into GitHub Actions (`ci-rust-event-exporter`).
… pipeline, and dual sinks

Part 2 of 3 adding networking, GKE credential rotation, bounded batching, and
Cloud Logging v2 + OpenTelemetry OTLP export sinks:

- `src/transport.rs` & `src/otlp_proto.rs`: Pure-Rust `reqwest` + `rustls` HTTP/2
  client (honoring GKE private-node `HTTP_PROXY`/`NO_PROXY` exemptions for
  `169.254.0.0/16` and `metadata.google.internal`) and `tonic`/`prost` OTLP
  `LogsService/Export` gRPC client.
- `src/auth.rs`: GKE `NodeTokenBroker` external-account STS exchange
  (`GOOGLE_APPLICATION_CREDENTIALS`), direct token-broker URL support, GCE
  Metadata Server fallback, K8s SA bearer rotation, and `--universe-domain`
  endpoint resolution.
- `src/sink.rs` & `src/pipeline.rs`: Byte-bounded (`16 MiB` default) micro-batch
  export queue with retry/jitter backoff, gzipped Cloud Logging `/v2/entries:write`
  JSON sink, and OTLP gRPC/HTTP sink preserving LOrIS status & freshness metrics.
…ckerfile, and E2E tests

Part 3 of 3 completing the standalone `event-exporter` binary, `distroless/static`
container build, and live multi-shard E2E test suites:

- `src/k8s_stream.rs`: Streaming `PartialObjectMetadata` Pod reflector with
  explicit `k8s.io/initial-events-end` bookmark gate, automatic HTTP 422
  paginated `List` fallback, Go `"items": null` empty-list handling, and
  line-by-line Event watcher with `410 Gone` watermark recovery.
- `src/main.rs`, `Dockerfile`, `Makefile`: Multi-arch (`linux/amd64`, `linux/arm64`)
  statically linked musl build (`+crt-static`) onto `gcr.io/distroless/static:latest`
  (`USER 65532:65532`), wired into `ci-container-build` and Dependabot.
- Subprocess CLI, WatchList premature-EOF regression, `410 Gone` recovery, and
  3-shard OTLP + HTTP 429 backpressure E2E test suites.
@zxqlxy
zxqlxy force-pushed the event-exporter-rs-pr3 branch from 01e2385 to 424434f Compare November 11, 2026 02:35
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