Grafana-Operator Add-on¶
The grafana-operator is a Kubernetes operator built to help you manage your Grafana instances inside and outside Kubernetes. Grafana Operator makes it possible for you to manage and create Grafana dashboards, datasources etc. declaratively between multiple instances in an easy and scalable way. Using grafana-operator, it will be possible to add AWS data sources such as Amazon Managed Service for Prometheus, Amazon CloudWatch, AWS X-Ray to Amazon Managed Grafana and create Grafana dashboards on Amazon Managed Grafana from your Amazon EKS cluster. This enables customers to use our Kubernetes cluster to create and manage the lifecyle of resources in Amazon Managed Grafana in a Kubernetes native way. This ultimately enables us to use GitOps mechanisms using CNCF projects such as FluxCD to create and manage the lifecyle of resources in Amazon Managed Grafana.
Usage¶
import * as cdk from 'aws-cdk-lib';
import * as blueprints from '@aws-quickstart/eks-blueprints';
const app = new cdk.App();
const addOn = new blueprints.addons.GrafanaOperatorAddon(),
const blueprint = blueprints.EksBlueprint.builder()
.version("auto")
.addOns(addOn)
.build(app, 'my-stack-name');
Configuration Options¶
-
createNamespace
: (boolean) If you want CDK to create the namespace for you. -
values
: Arbitrary values to pass to the chart. Refer to the Grafana Operator Helm Chart documentation for additional details. It also supports all standard helm configuration options.
Validation¶
To validate that Grafana Operator is installed properly in the cluster, check if the namespace is created and pods are running.
Verify if the namespace is created correctly
kubectl get ns | grep "grafana-operator"
grafana-operator Active 31m
kubectl get all -n grafana-operator
NAME READY STATUS RESTARTS AGE
pod/grafana-operator-779956546b-q5tlf 2/2 Running 0 3m7s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/grafana-operator-metrics-service ClusterIP 172.20.255.216 <none> 8443/TCP 3m7s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/grafana-operator 1/1 1 1 3m7s
NAME DESIRED CURRENT READY AGE
replicaset.apps/grafana-operator-779956546b 1 1 1 3m7s
Testing¶
Please refer to the AWS Blog Using Open Source Grafana Operator on your Kubernetes cluster to manage Amazon Managed Grafana on testing the following features :
- Setting up Grafana Identity to Amazon Managed Grafana.
- Adding AWS data sources such as Amazon Managed Service For Prometheus, Amazon CloudWatch, AWS X-Ray.
- Creating Grafana Dashboards on Amazon Managed Grafana with Grafana Operator.