Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions event-exporter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.PHONY: e2e

all: container

ENVVAR = GOOS=linux GOARCH=amd64 CGO_ENABLED=0
Expand All @@ -35,6 +37,9 @@ build: test
test:
${ENVVAR} go test -mod=vendor ./...

e2e:
./hack/e2e-kind.sh

container: .container

.container:
Expand Down
11 changes: 8 additions & 3 deletions event-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ spec:
containers:
- name: event-exporter
image: gcr.io/google-containers/event-exporter:v0.1.4
command:
- '/event-exporter'
command:
- '/event-exporter'
```

## E2E workflow

For local end-to-end validation (functional parity + perf numbers) using a kind
cluster, see `docs/e2e.md`.

## Notes
### ClusterRoleBinding
This pod's service account should be authorized to get events, you
Expand All @@ -83,4 +88,4 @@ the `example` directory.
### "resourceVersion for the provided watch is too old"
On a system with few/no events, you may see "The resourceVersion for the provided
watch is too old" warnings. These can be ignored. This is due to compacted resource
versions being referenced.
versions being referenced.
82 changes: 82 additions & 0 deletions event-exporter/docs/e2e.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Event Exporter E2E Workflow

This document describes the local end-to-end (E2E) workflow used to validate
functional parity and compare performance between `core/v1` Events and
`events.k8s.io/v1` series updates.

## What the E2E test covers
- Validates that events flow end-to-end from the API server to the exporter
(using a local in-memory sink).
- Verifies required fields are present (`InvolvedObject`, `Reason`, `Message`).
- Reports throughput (occurrences per second) for both core/v1 and events/v1.

## Prerequisites
- Go toolchain (matches `event-exporter/go.mod`)
- kind (Kubernetes in Docker)
- Install: `go install sigs.k8s.io/kind@v0.24.0`
- kubectl (optional, for inspection/debugging)

## Quick start
From the repository root:

```sh
event-exporter/hack/e2e-kind.sh
```

The script:
- Creates or reuses a kind cluster (`event-exporter-e2e` by default).
- Runs `go test -tags e2e` with a kubeconfig generated by kind.
- Prints per-path throughput logs in the test output.

## Configuration knobs
All values are optional and can be exported before running the script.

- `KIND_CLUSTER_NAME` (default `event-exporter-e2e`)
- `E2E_EVENT_COUNT` (default `200`)
- `E2E_SERIES_STEP` (default `10`)
- `E2E_TIMEOUT` (default `2m`)
- `E2E_NAMESPACE` (default `event-exporter-e2e`)
- `E2E_KEEP_CLUSTER` (default `true`)

Example:

```sh
E2E_EVENT_COUNT=1000 E2E_SERIES_STEP=20 E2E_TIMEOUT=5m event-exporter/hack/e2e-kind.sh
```

## Interpreting results
The test logs two lines:
- `core/v1: processed=... occurrences=... throughput=...`
- `events.k8s.io/v1: processed=... occurrences=... throughput=...`

Higher throughput in the events/v1 path is expected because series updates
reduce watch update volume for repeated events.

## Results template
Use this block in PRs to keep reporting consistent:

```text
E2E env:
KIND_CLUSTER_NAME=event-exporter-e2e
E2E_EVENT_COUNT=200
E2E_SERIES_STEP=10
E2E_TIMEOUT=2m
E2E_NAMESPACE=event-exporter-e2e

Results:
core/v1: processed=..., updates=..., occurrences=..., elapsed=..., throughput=... occ/s
events.k8s.io/v1: processed=..., updates=..., occurrences=..., elapsed=..., throughput=... occ/s
```

## Cleanup
If you do not want to keep the cluster:

```sh
E2E_KEEP_CLUSTER=false event-exporter/hack/e2e-kind.sh
```

Or delete manually:

```sh
kind delete cluster --name event-exporter-e2e
```
Loading
Loading