Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
x0ddf committed Feb 9, 2025
1 parent 0a1033d commit 7921c71
Showing 1 changed file with 97 additions and 5 deletions.
102 changes: 97 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

A Kubernetes admission controller that automatically tracks resource creation and modification by adding user information labels.

## This project is in early development(could be used in production).
Things to do:
- Add tests
- Add documentation
- Add examples
- Add features:
- Other labels
- Think about annotations
- Metrics


## Overview

WhoDidThat Controller is a Kubernetes mutating admission webhook that adds audit labels to resources, tracking who created and last modified them. It adds the following labels:
Expand All @@ -24,10 +35,91 @@ WhoDidThat Controller is a Kubernetes mutating admission webhook that adds audit

## Installation

### Using Helm (Recommended)
### Install the chart

```bash
helm install whodidthat oci://ghcr.io/x0ddf/whodidthat
```

### Configuration

The following table lists the configurable parameters of the WhoDidThat chart and their default values:

| Parameter | Description | Default |
|-----------|-------------|---------|
| `replicaCount` | Number of controller replicas | `1` |
| `image.repository` | Image repository | `ghcr.io/x0ddf/whodidthat-controller` |
| `image.tag` | Image tag | `latest` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `resources.limits.cpu` | CPU limit | `500m` |
| `resources.limits.memory` | Memory limit | `128Mi` |
| `resources.requests.cpu` | CPU request | `100m` |
| `resources.requests.memory` | Memory request | `64Mi` |
| `certManager.enabled` | Enable cert-manager integration | `true` |
| `webhook.failurePolicy` | Webhook failure policy | `Ignore` |
| `webhook.timeoutSeconds` | Webhook timeout | `5` |

## Usage

Once installed, the controller automatically adds labels to resources when they are created or modified.

Example resource with added labels:

```yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
audit.k8s.io/created-by: john@example.com
audit.k8s.io/last-modified-by: jane@example.com
spec:
containers:
- name: nginx
image: nginx:latest
```
## Development
### Prerequisites
- Go 1.23+
- Docker
### Building
Build the binary:
```bash
go build -o whodidthat-controller
```

Build multi-arch container image:
```bash
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/<your-github-username>/whodidthat-controller:latest \
--push \
.
```

### Running Tests

```bash
go test ./...
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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.

1. Add the repository:
```bash
helm repo add whodidthat https://x0ddf.github.io/whodidthat-controller
```

0 comments on commit 7921c71

Please sign in to comment.