Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grafana/kubernetes-diff-logger
Logs updates to Kubernetes Objects for storing and querying with Loki
https://github.com/grafana/kubernetes-diff-logger
Last synced: 28 days ago
JSON representation
Logs updates to Kubernetes Objects for storing and querying with Loki
- Host: GitHub
- URL: https://github.com/grafana/kubernetes-diff-logger
- Owner: grafana
- License: apache-2.0
- Created: 2019-10-23T17:24:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-09T22:05:36.000Z (5 months ago)
- Last Synced: 2024-09-28T15:01:49.482Z (about 1 month ago)
- Language: Go
- Homepage:
- Size: 73.2 KB
- Stars: 123
- Watchers: 141
- Forks: 20
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# kubernetes-diff-logger
This simple application is designed to watch Kubernetes objects and log diffs when they occur. It is designed to log changes to Kubernetes objects in a clean way for storage and processing in [Loki](https://github.com/grafana/loki/).
## Example
```
./kubernetes-diff-logger -namespace=default
{"timestamp":"2019-10-23T16:57:23Z","verb":"updated","type":"deployment","notes":"[Replicas: 1 != 2]", "name":"nginx"}}
{"timestamp":"2019-10-23T16:57:35Z","verb":"updated","type":"deployment","notes":"[Template.Spec.Containers.slice[0].Image: nginx != nginx:latest]", "name":"nginx"}}
```See [Deployment](./deployment) for example yaml to deploy to Kubernetes. The example will monitor and log information about changes in all namespaces.
## Usage
```
Usage of ./kubernetes-diff-logger:
-config string
Path to config file. Required.
-kubeconfig string
Path to a kubeconfig. Only required if out-of-cluster.
-log-added
Log when deployments are added.
-log-deleted
Log when deployments are deleted.
-master string
The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.
-namespace string
Filter updates by namespace. Leave empty to watch all.
-resync duration
Periodic interval in which to force resync objects. (default 30s)
```## Config File
```yaml
differs:
- nameFilter: "*"
type: "deployment"
- nameFilter: "*"
type: "statefulset"
- nameFilter: "*"
type: "daemonset"
```