kubernetes / kubernetes/kubectl

Add --skip-logs and --skip-events flags to kubectl cluster-info dump

Open
#1,866 2 comments 0 reactions 0 assignees View on GitHub
kind/feature needs-triage
Dominant language
Go
Stars
3.3k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

### What would you like to be added?

Add two flags to `kubectl cluster-info dump`:

- `--skip-logs`: Do not retrieve pod logs.
- `--skip-events`: Do not retrieve Events.

Both flags would default to `false`, preserving existing behavior.

Examples:

kubectl cluster-info dump --skip-logs
kubectl cluster-info dump --skip-events
kubectl cluster-info dump --skip-logs --skip-events

### Why is this needed?

`kubectl cluster-info dump` currently always retrieves events and logs for every
selected namespace. In some environments this:

- makes the dump substantially slower and larger.
- collects potentially sensitive application log data unnecessarily.
- prevents callers from creating a resource-state-only diagnostic bundle.

### Proposed behavior

- Existing behavior remains unchanged when neither flag is supplied.
- `--skip-logs` avoids all pod log API requests and does not create log files.
- `--skip-events` avoids all Event list requests and does not create event files.

Contributor guide

Open the contributing guide

Research direction

Start at the kubectl cluster-info dump command and trace where pod logs and Events are retrieved and written. Add the two flags with false defaults, then verify that each flag prevents its corresponding API requests and output files while preserving existing behavior when neither is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.