A deployment-ready graphite cluster on top of Kubernetes.
- Carbon relay deployment and service to spread metrics across several Graphite data nodes
- Graphite data nodes as a stateful set with persistent volumes
- Graphite query node to be used as a query gateway to the data nodes
- Config Map used for storage schema
- Graphite Version 1.1.5 I used the latests release
- Kubernetes version v1.11.x
- kubectl configured to work with your Kubernetes API
- Clone this repository
- Create Config Maps: kubectl create configmap graphite-config --from-file=graphite-config
- Run: kubctl create for every compontent and service
- carbon-relay:2004 is the service pod for sending metrics with pickle protocol
- graphite:80 is the host for you metrics queries. It points to the graphite query node which queries all data nodes in the cluster.
kubectl port-forward svc/graphite 8080:80
//TODO
If you need to change and edit docker images //TODO
Graphite data nodes are deployed as StatefulSets. Both Graphite master and carbon relays continuously watch the Kubernetes API for Graphite nodes endpoints and update the configuration. You can scale deployments and statfull state accordingly to your own need.
I had to keep 3 year of data, the data files were of diffrent sizes ranging between kilobytes to 128mb. My config was:
Carbon-relay: 6 nodes they used about 100 =~ 200 mb of memory Graphite-Data-Node: 4 with 2TB storage, standarad storage, I also utilized Redis for TagDB and memcached This one is more resource intensive and scaled past 16g memory //TODO Graphite-Query-Node: 3 Nodes memory usage is about 200mb
I've been able to send between 250k to 1mil of messages, with no real issue. I used Grafana to connect to the Graphite-Query-Node, and been able to get data past 2 year with no real performance issue.
I've learned and used some of the elements from this articale thanks to Nanit and Erez Rabih This article