Deploy InfluxDB on Kubernetes: Time-Series Database

Deploy InfluxDB on Kubernetes to process time-series metrics, telemetry, and real-time analytics. Running InfluxDB as a StatefulSet ensures persistent data storage and reliable network identity across container restarts. This setup provisions a single-replica InfluxDB instance with automated initial setup, internal ClusterIP service routing, and HTTP health probes.
| Component | Type | Port | Role |
|---|---|---|---|
| influxdb | Namespace | N/A | Isolates InfluxDB resources |
| influxdb-config | ConfigMap | N/A | Holds custom InfluxDB runtime configuration options |
| influxdb | Service | 8086 | Exposes InfluxDB HTTP API internally via ClusterIP |
| influxdb | StatefulSet | 8086 | Runs single-replica InfluxDB 2.7 engine container |
| influxdb-storage | PersistentVolumeClaim | N/A | Provisions 10Gi persistent volume for metric engine storage |
| influxdb-secret | Secret | N/A | Stores initialization credentials, org, bucket, and token |
The InfluxDB StatefulSet executes a single container running InfluxDB. Initialization parameters, including administrative credentials, organization name, default bucket, and API token, load directly from the Secret. The ClusterIP Service exposes HTTP API port 8086 inside the cluster, while HTTP GET probes continuously monitor the /health endpoint for startup, readiness, and liveness states.
influxdb namespace.influxdb-secret.influxdb-config if default settings require overrides.kubectl exec -n influxdb-ansar statefulset/influxdb -- curl -i http://localhost:8086/health.kubectl exec -n influxdb-ansar statefulset/influxdb -- influx ping.kubectl exec -n influxdb-ansar statefulset/influxdb -- influx bucket list -o kubekanvas -t my-super-secret-token.This template configures a secure InfluxDB 2.7 deployment on Kubernetes using a StatefulSet, persistent storage volume, automated initial setup credentials, and HTTP health probes.