How to set up influxdb on kubernetes

Introduction

Influxdb is a time series database. you can collect data into influxdb to show on Grafana dashboard. So I will write down I how to set up influxdb (v1, v2) on Kubernetes. But why not use Prometheus because it is a pull based time series database. If you want to collect very real-time data like business metrics clearly not suitable.

Prerequisite

Installation

First, you need to add influxdata repo into helm.

1
helm repo add influxdata https://helm.influxdata.com/

v1

1
helm --namespace=$(NS) upgrade --install influxdb influxdata/influxdb -f values.yaml

v2

1
helm --namespace=$(NS) upgrade --install influxdb2 influxdata/influxdb2 -f values.yaml

Configuration

v1

You can reference official documents influxdb

1
helm show values influxdata/influxdb > values.yaml

v2

1
helm show values influxdata/influxdb2 > values.yaml

You can change adminUser field to you want. like

1
2
3
4
5
6
7
8
9
adminUser:
organization: "my-org"
bucket: "my-bucket"
user: "admin"
retention_policy: "0s"
## Leave empty to generate a random password and token.
## Or fill any of these values to use fixed values.
password: "<<password>>"
token: "<<token>>"