cdk8s-grafana
cdk8s-grafana is a library that lets you easily define a Grafana service for your kubernetes cluster along with associated dashboards and datasources, using a high level API.
Usage
To apply the resources generated by this construct, the Grafana operator must be installed on your cluster. See https://operatorhub.io/operator/grafana-operator for full installation instructions.
The following will define a Grafana cluster connected to a Prometheus datasource:
import { Grafana } from 'cdk8s-grafana';
// inside your chart:
const grafana = new Grafana(this, 'my-grafana', {
defaultDataSource: {
name: 'Prometheus',
type: 'prometheus',
access: 'proxy',
url: 'http://prometheus-service:9090',
}
});
Basic aspects of a dashboard can be customized:
const github = grafana.addDatasource('github', ...);
const dashboard = grafana.addDashboard('my-dashboard', {
title: 'My Dashboard',
refreshRate: Duration.seconds(10),
timeRange: Duration.hours(6), // show metrics from now-6h to now
plugins: [
{
name: 'grafana-piechart-panel',
version: '1.3.6',
}
],
});
Note: the kubernetes grafana operator only supports one Grafana instance per namespace (see https://github.com/grafana-operator/grafana-operator/issues/174). This may require specifying namespaces explicitly, e.g.:
const devGrafana = new Grafana(this, 'my-grafana', {
namespace: 'dev',
});
const prodGrafana = new Grafana(this, 'my-grafana', {
namespace: 'prod',
});
The grafana operator must be installed in each namespace for the resources in that namespace to be recognized.
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.
Metadata
Release files for cdk8s-grafana 0.1.813
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cdk8s_grafana-0.1.813.tar.gz | 327.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cdk8s_grafana-0.1.813-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 653.7 kB
Release files / cdk8s_grafana-0.1.813.tar.gz
| Download URL | cdk8s_grafana-0.1.813.tar.gz |
|---|---|
| Size | 327.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4aea8e52faef9f616cf6d51088e1b8cb0b7423a36630ed3daedd8648ed776370
|
|
BLAKE2b-256 checksum How to use checksums |
e708a703c88573dd8e42934653db6ef7f2329d53ae977a910688d5d1ae108178
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.14.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / cdk8s_grafana-0.1.813-py3-none-any.whl
| Download URL | cdk8s_grafana-0.1.813-py3-none-any.whl |
|---|---|
| Size | 325.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61814b431929eba8a0981039692b9a0ea4108e038b5f24d20488570ce7761075
|
|
BLAKE2b-256 checksum How to use checksums |
f3e9d5c9df9b35c3373f9e2094a1d60a2389a0759ec13d677f9c810d11337c4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.14.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency log