Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joe-elliott/kubernetes-grafana-controller
A Kubernetes controller used to sync CRDs with Grafana
https://github.com/joe-elliott/kubernetes-grafana-controller
grafana kubernetes
Last synced: 3 months ago
JSON representation
A Kubernetes controller used to sync CRDs with Grafana
- Host: GitHub
- URL: https://github.com/joe-elliott/kubernetes-grafana-controller
- Owner: joe-elliott
- License: apache-2.0
- Created: 2018-12-17T21:03:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-07T14:08:37.000Z (over 5 years ago)
- Last Synced: 2024-06-20T05:26:57.472Z (7 months ago)
- Topics: grafana, kubernetes
- Language: Go
- Homepage:
- Size: 326 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# kubernetes-grafana-controller
[![Go Report Card](https://goreportcard.com/badge/github.com/joe-elliott/kubernetes-grafana-controller)](https://goreportcard.com/report/github.com/joe-elliott/kubernetes-grafana-controller)
This controller will maintain the state of a Grafana instance by syncing it with objects created in Kubernetes. It is under active development.
The primary motivator for creating this controller is to allow development teams to include their Grafana dashboards in the same source repos as their code alongside other Kubernetes objects.
- [tests](test/readme.md)
## CLI
```
-grafana string
The address of the Grafana server. (default "http://grafana")
-kubeconfig string
Path to a kubeconfig. Only required if out-of-cluster.
-master string
The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.
-resync duration
Periodic interval in which to force resync objects. (default 30s)
-resync-delete duration
Periodic interval in which to force resync deleted objects. Pass 0s to disable. (default 30s)
-prometheus-listen-address string
The address to listen on for Prometheus scrapes. (default ":8080")
-prometheus-path string
The path to publish Prometheus metrics to. (default "/metrics")klog
-alsologtostderr
log to standard error as well as files
-log_backtrace_at value
when logging hits line file:N, emit a stack trace
-log_dir string
If non-empty, write log files in this directory
-log_file string
If non-empty, use this log file
-logtostderr
log to standard error instead of files
-skip_headers
If true, avoid header prefixes in the log messages
-stderrthreshold value
logs at or above this threshold go to stderr (default 2)
-v value
log level for V logs
-vmodule value
comma-separated list of pattern=N settings for file-filtered logging
```## Metrics
The kubernetes-grafana-controller publishes a metrics in the prometheus format. These include error totals, grafana latencies and other totals.
https://github.com/joe-elliott/kubernetes-grafana-controller/blob/master/pkg/prometheus/prometheus.go
## Custom Resource Definitions
The kubernetes-grafana-controller currently will sync the following objects.
### Dashboards
```
apiVersion: grafana.com/v1alpha1
kind: Dashboard
metadata:
name: test
spec:
folderName:
json:
```### Folders
```
apiVersion: grafana.com/v1alpha1
kind: Folder
metadata:
name: test
spec:
json:
```### AlertNotifications (Notification Channels)
```
apiVersion: grafana.com/v1alpha1
kind: AlertNotification
metadata:
name: test
spec:
json:
```### DataSources
```
apiVersion: grafana.com/v1alpha1
kind: DataSource
metadata:
name: test
spec:
json:
```## Requirements
This controller requires the `CustomResourceSubresources` feature gate to enabled. This has been enabled by default since k8s 1.11.