Metadata-Version: 2.4
Name: kge-kubectl-get-events
Version: 0.11.4
Summary: Kubernetes utility for viewing pod and failed replicaset events
Author-email: Jesse Goodier <31039225+jessegoodier@users.noreply.github.com>
License: MIT
Project-URL: Homepage, https://github.com/jessegoodier/kge
Project-URL: Repository, https://github.com/jessegoodier/kge
Project-URL: Documentation, https://github.com/jessegoodier/kge/blob/main/README.md
Project-URL: Bug Tracker, https://github.com/jessegoodier/kge/issues
Keywords: kubernetes,troubleshooting,kubectl,events,pod,replicaset,failed,event
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: <4.0,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rich<14.0.0,>=13.7.0
Requires-Dist: kubernetes<33.0.0,>=32.0.1
Requires-Dist: prompt_toolkit
Provides-Extra: dev
Requires-Dist: pytest<9.0.0,>=8.0.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: build; extra == "dev"
Dynamic: license-file

# kge - Kubernetes Events Viewer

[![Python Version](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI](https://img.shields.io/pypi/v/kge-kubectl-get-events)](https://pypi.org/project/kge-kubectl-get-events/)

A simple yet powerful CLI tool for viewing and monitoring Kubernetes events with a focus on readability and ease of use. `kge` provides an intuitive interface to quickly diagnose issues.

## Table of Contents

- [kge - Kubernetes Events Viewer](#kge---kubernetes-events-viewer)
  - [Table of Contents](#table-of-contents)
  - [Features](#features)
  - [Installation](#installation)
  - [Usage](#usage)
    - [Interactive Mode](#interactive-mode)
    - [Basic Usage](#basic-usage)
    - [Viewing Events for Any Resource Type](#viewing-events-for-any-resource-type)
    - [Shell Completion](#shell-completion)
  - [Examples](#examples)
  - [Known Issues](#known-issues)
  - [Contributing](#contributing)
  - [License](#license)

## Features

- 🔍 View events for specific pods
- 👻 Find missing pods because of missing serviceAccounts or volumes
- 📊 View all events in a namespace
- ⚠️ Filter to show only non-normal events
- 🖱️ Interactive pod selection
- 🎨 Color-coded output
- ⌨️ Shell completion support (zsh)
- 🔄 View events for any Kubernetes resource type (Pods, Deployments, CRDs, etc.)

## Installation

A brew formula is a WIP. Until then, use pipx. Which can be installed with `brew install pipx`
Pipx is like brew, only for python.

```bash
# Install using pipx (recommended)
pipx install kge-kubectl-get-events
```

```bash
# Or install using pip, but not as easy
pip install kge-kubectl-get-events
```

## Usage

### Interactive Mode

Run without arguments for interactive pod selection:

```bash
kge
```

### Basic Usage

View events for a specific pod:

```bash
kge <pod-name>
```

View events in all namespaces:

```bash
kge -A
```



View events in a specific namespace:

```bash
kge -n <namespace>
```

### Viewing Events for Any Resource Type

View events for a specific resource type:

```bash
kge -k <kind> <resource-name>
```

Check a different namespace than your current context:

```bash
kge -n kubecost
```

TODO:View only non-normal events:

```bash
kge -e
```

Combine flags to view all non-normal events in the current namespace:

```bash
kge -ea
```

### Shell Completion

Enable zsh completion:

```bash
source <(kge --completion=zsh)
```

Completion features:

- Tab completion for namespaces after `-n`
- Tab completion for pods after `-n <namespace>`
- Tab completion for kinds after `-k`
- Tab completion for resources of a specific kind after `-k <kind>`

## Examples

View non-normal events for all pods in a namespace:

```bash
kge -ea
```

View events for a specific pod in a specific namespace:

```bash
kge -n my-namespace my-pod
```

View events for a Deployment:

```bash
kge -k Deployment my-deployment
```

## Known Issues

- Not all arguments work together. For example, `kge -e -k Deployment` will not work. For complex queries, use `kge -a` to see all events and filter with `grep` or another tool.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
