influxdb2
by Helm
A Helm chart for InfluxDB v2
About this chart
InfluxDB v2 Helm chart
InfluxDB is an open source time series database with no external dependencies. It's useful for recording metrics, events, and performing analytics.
The InfluxDB v2 Helm chart uses the Helm package manager to bootstrap an InfluxDB v2 StatefulSet and service on a Kubernetes cluster.
Prerequisites
- Helm v3 or later
- Kubernetes 1.4+
- (Optional) PersistentVolume (PV) provisioner support in the underlying infrastructure
Install the chart
-
Add the InfluxData Helm repository:
helm repo add influxdata https://helm.influxdata.com/ -
Run the following command, providing a name for your InfluxDB release:
helm upgrade --install my-release influxdata/influxdb2Tip:
--installcan be shortened to-i.This command deploys InfluxDB v2 on the Kubernetes cluster using the default configuration.
Tip: To view all Helm chart releases, run
helm list.
Uninstall the chart
To uninstall the my-release deployment, use the following command:
helm uninstall my-release
This command removes all Kubernetes components associated with the chart and deletes the release.
Persistence
The InfluxDB v2 image stores data in the /var/lib/influxdb2 directory in the container.
If persistence is enabled, a Persistent Volume associated with StatefulSet is provisioned. The volume is created using dynamic volume provisioning. In case of a disruption (for example, a node drain), Kubernetes ensures that the same volume is reattached to the Pod, preventing any data loss. However, when persistence is not enabled, InfluxDB data is stored in an empty directory, so if a Pod restarts, data is lost.
Check out our Slack channel for support and information.
Fixed Auth Credentials
If you need to use fixed token and/or password you can set the values
adminUser.password and adminUser.token or you can use an existing secret,
which would be a better approach.
Example Secret:
apiVersion: v1
kind: Secret
metadata:
name: influxdb-auth
type: Opaque
data:
admin-password: ...
admin-token: ...
If you do not specify an existing secret, the admin-password and admin-token
will be automatically generated. They will remain consistent even after
helm upgrade.
Influx setup
By default this chart uses the docker hub influxdb image which includes an entrypoint for automatically setting up InfluxDB. This operation is idempotent and will be skipped if a boltdb is found on startup.
For more information see "Automated Setup" in the docker image README.
For configuration options see adminUser in values.yaml.
Configuration
Extra environment variables can be passed influxdb using .Values.env. For
example:
env:
- name: FOO
value: BAR
- name: BAZ
valueFrom:
secretKeyRef:
name: my-secret
key: my-key
Deploy influxdb2 with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has influxdb2 on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartinfluxdb2 is pinned at v2.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply