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!

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.