InfluxDB HELM on Kubernetes

Congratulations on successfully completing my previous tutorial deploying Grafana on Kubernetes using Helm!
With Grafana’s powerful visualization capabilities now at your fingertips, it’s time to enhance your monitoring stack further by adding InfluxDB,
a high-performance time-series database optimized for handling metrics and events.

InfluxDB seamlessly integrates with Grafana, providing a robust backend storage solution for your monitoring data.
By deploying InfluxDB on Kubernetes, you gain scalability, resilience, and flexibility, enabling you to handle the dynamic nature of modern applications and infrastructure.

In this tutorial, I’ll guide you through the process of deploying InfluxDB on Kubernetes, building upon the foundation laid by your Grafana deployment.
You’ll learn how to leverage Helm charts and Kubernetes resources to set up a fully functional InfluxDB instance in your cluster.

Whether you’re monitoring microservices, IoT devices, or traditional server infrastructure, InfluxDB empowers you to store, query, and analyze time-series data with ease.
By combining InfluxDB with Grafana, you’ll have a comprehensive monitoring solution that provides insights into every aspect of your environment.

Get ready to take your monitoring capabilities to the next level as we dive into the deployment of InfluxDB on Kubernetes. Let’s dive in!

What is InfluxDB ?

InfluxDB is an open source Time Serie Database (TSDB).
It is specialized in operations like monitoring, application metrics, Internet of Things (IoT) sensors data and real-time analytics.
It is mainly written in Go language and is designed for high-performance and high-efficiency storage.
It can store thousands of data points every second making it perfect for industrial grade applications.

Once stored, data can be queried and analyzed using the “Flux” language.
This language is an integral part of InfluxDB and permits advanced data manipulations to analyze your data in an incredible depth.

When to use InfluxDB ?

InfluxDB is perfect if you want to store, query and analyze metrics data, like IoT sensors, monitoring records or applications metrics.

Typically, IoT devices that are connected using WiFi, 5G, Sigfox or LoRa networks send their sensors values (temperatures, 3 axis accelerometer, GPS coordinates, etc…) at regular intervals. These data are enhanced with health data like battery voltage and network reception.
There IoT devices will send all these data at regular intervals to InfluxDB that will store them in an efficient way.

With its high performances API, InfluxDB can ingest thousands of data per seconds with no problem.
And with its advanced “Flux” language, you will be able to query and analyze these data in few lines.

Prerequisites:

          Kubernetes cluster   –> kubernetes cluster installation tutorial: https://eli-bukin.com/projects/singlenode-rke-cluster-installation/

          HELM installed   –> installation docs: https://helm.sh/docs/intro/install/

          Kubectl installed   –> installation docs: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

          Load Balancer   –> instructions for deployment: https://eli-bukin.com/deploy-metallb-load-balancer-on-kubernetes/

          InfluxData HELM charts   –> https://github.com/influxdata/helm-charts.git

first let’s clone the repo.

git clone https://github.com/influxdata/helm-charts.git

create a namespace for influxdb.

kubectl create namespace influxdb-ns

modify “values.yaml” and change service type to “LoadBalancer”

service:
  ## Add annotations to service
  # annotations: {}
  type: LoadBalancer
  # externalIPs: []
  # externalTrafficPolicy: ""
  # nodePort(s) value for the LoadBalancer and NodePort service types
  nodePorts:
    http: ""

persistence comes on out of the box but you will have to create a PV.
run this to create a PV with specific claimRef

                    NOTE: the volume folder has to prepared upfront

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolume
metadata:
  name: influxdb-ns
spec:
  accessModes:
    - ReadWriteOnce
  capacity:
    storage: 8Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: influxdb-data-influxdb-0 
    namespace: influxdb-ns
  hostPath:
    path: /path/to/your/folder
    type: ''
  persistentVolumeReclaimPolicy: Retain
  volumeMode: Filesystem
EOF

now run helm to install the chart.

helm install influxdb helm-charts/charts/influxdb/ -n influxdb-ns

execute “kubectl get all –namespace influxdb-ns” and get the server IP from the loadbalancer.

now you can test connection with telnet.

And of course you can curl to this path and get more details about your database server.