Introducing our new CEO Don Johnson - Read More

bitnamicharts/influxdb

Verified Publisher

By VMware

Updated 1 day ago

Bitnami Helm chart for InfluxDB(TM)

Image
Helm
Databases & Storage
Internet of Things
Monitoring & Observability
0

100K+

Bitnami Stack for InfluxDB(TM)

InfluxDB(TM) is an open source time-series database. It is a core component of the TICK (Telegraf, InfluxDB(TM), Chronograf, Kapacitor) stack.

Overview of InfluxDB™

InfluxDB(TM) is a trademark owned by InfluxData, which is not affiliated with, and does not endorse, this site.

TL;DR

helm install my-release oci://registry-1.docker.io/bitnamicharts/influxdb

Looking to use InfluxDB™ in production? Try VMware Tanzu Application Catalog, the commercial edition of the Bitnami catalog.

Introduction

This chart bootstraps a influxdb deployment on a Kubernetes cluster using the Helm package manager.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters.

Prerequisites

  • Kubernetes 1.23+
  • Helm 3.8.0+
  • PV provisioner support in the underlying infrastructure
  • ReadWriteMany volumes for deployment scaling

Installing the Chart

To install the chart with the release name my-release:

helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/influxdb

Note: You need to substitute the placeholders REGISTRY_NAME and REPOSITORY_NAME with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use REGISTRY_NAME=registry-1.docker.io and REPOSITORY_NAME=bitnamicharts.

These commands deploy influxdb on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Configuration and installation details

Resource requests and limits

Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the resources value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.

To make this process easier, the chart contains the resourcesPreset values, which automatically sets the resources section according to different presets. Check these presets in the bitnami/common chart. However, in production workloads using resourcesPreset is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the official Kubernetes documentation.

Update credentials

Bitnami charts configure credentials at first boot. Any further change in the secrets or credentials require manual intervention. Follow these instructions:

  • Update the user password following the upstream documentation
  • Update the password secret with the new values (replace the SECRET_NAME, ADMIN_PASSWORD and ADMIN_USER_TOKEN placeholders)
kubectl create secret generic SECRET_NAME --from-literal=admin-user-password=PASSWORD --from-literal=admin-user-token=ADMIN_USER_TOKEN --dry-run -o yaml | kubectl apply -f -
Prometheus metrics

This chart can be integrated with Prometheus by setting metrics.enabled to true. This will expose the InfluxDB native Prometheus endpoint. Additionally, it will deploy a metrics service, which can be configured under the metrics.service section. This metrics service will have the necessary annotations to be automatically scraped by Prometheus.

Prometheus requirements

It is necessary to have a working installation of Prometheus or Prometheus Operator for the integration to work. Install the Bitnami Prometheus helm chart or the Bitnami Kube Prometheus helm chart to easily have a working Prometheus in your cluster.

Integration with Prometheus Operator

The chart can deploy ServiceMonitor objects for integration with Prometheus Operator installations. To do so, set the value metrics.serviceMonitor.enabled=true. Ensure that the Prometheus Operator CustomResourceDefinitions are installed in the cluster or it will fail with the following error:

no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"

Install the Bitnami Kube Prometheus helm chart for having the necessary CRDs and the Prometheus Operator.

Rolling VS Immutable tags

It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.

Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.

This chart installs a deployment with the following configuration:

                ------------------
               |     Ingress      |
               |    Controller    |
                ------------------
                        |
                        | /query
                        | /write
                        \/
                 ----------------
                |  InfluxDB(TM)  |
                |      svc       |
                 ----------------
                        |
                        \/
                  --------------
                 | InfluxDB(TM) |
                 |    Server    |
                 |     Pod      |
                  --------------
Configure the way how to expose InfluxDB™
  • Ingress: The ingress controller must be installed in the Kubernetes cluster. Set ingress.enabled=true to expose InfluxDB™ through Ingress.
  • ClusterIP: Exposes the service on a cluster-internal IP. Choosing this value makes the service only reachable from within the cluster. Set influxdb.service.type=ClusterIP to choose this service type.
  • NodePort: Exposes the service on each Node's IP at a static port (the NodePort). You'll be able to contact the NodePort service, from outside the cluster, by requesting NodeIP:NodePort. Set influxdb.service.type=NodePort to choose this service type.
  • LoadBalancer: Exposes the service externally using a cloud provider's load balancer. Set influxdb.service.type=LoadBalancer to choose this service type.
Using custom configuration

This helm chart supports to customize the whole configuration file.

Add your custom configuration file to "files/conf" in your working directory. This file will be mounted as a configMap to the containers and it will be used for configuring InfluxDB™.

Alternatively, you can specify the InfluxDB™ configuration using the influxdb.configuration parameter.

In addition to these options, you can also set an external ConfigMap with all the configuration files. This is done by setting the influxdb.existingConfiguration parameter. Note that this will override the two previous options.

Adding extra environment variables

In case you want to add extra environment variables, you can use the influxdb.extraEnvVars property.

extraEnvVars:
  - name: INFLUXDB_DATA_QUERY_LOG_ENABLED
    value: "true"
Initialize a fresh instance

The Bitnami InfluxDB™ image allows you to use your custom scripts to initialize a fresh instance. In order to execute the scripts, they must be located inside the chart folder files/docker-entrypoint-initdb.d so they can be consumed as a ConfigMap.

Alternatively, you can specify custom scripts using the influxdb.initdbScripts parameter.

In addition to these options, you can also set an external ConfigMap with all the initialization scripts. This is done by setting the influxdb.initdbScriptsCM parameter. Note that this will override the two previous options. parameter.

The allowed extensions are .sh, and .txt.

Migrating InfluxDB 1.x data into 2.x format

The Bitnami InfluxDB™ image allows you to migrate your InfluxDB 1.x data into 2.x format by setting the INFLUXDB_INIT_MODE=upgrade environment variable, and mounting the InfluxDB 1.x data into the container (let the initialization logic know where it is located with the INFLUXDB_INIT_V1_DIR variable). Do not point INFLUXDB_INIT_V1_DIR into INFLUXDB_VOLUME_DIR (default: /bitnami/influxdb), or the upgrade process will fail.

Setting Pod's affinity

This chart allows you to set your custom affinity using the XXX.affinity parameter(s). Find more information about Pod's affinity in the kubernetes documentation.

As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the bitnami/common chart. To do so, set the XXX.podAffinityPreset, XXX.podAntiAffinityPreset, or XXX.nodeAffinityPreset parameters.

Backup and restore

To back up and restore Helm chart deployments on Kubernetes, you need to back up the persistent volumes from the source deployment and attach them to a new deployment using Velero, a Kubernetes backup/restore tool. Find the instructions for using Velero in this guide.

Persistence

The data is persisted by default using PVC(s). You can disable the persistence setting the persistence.enabled parameter to false. A default StorageClass is needed in the Kubernetes cluster to dynamically provision the volumes. Specify another StorageClass in the persistence.storageClass or set persistence.existingClaim if you have already existing persistent volumes to use.

If you would like to define persistence settings for a backup volume that differ from the persistence settings for the database volume, you may do so under the backup.persistence section of the configuration by setting backup.persistence.ownConfig to true. The backup volume will otherwise be defined using the persistence parameter section.

Adjust permissions of persistent volume mountpoint

As the images run as non-root by default, it is necessary to adjust the ownership of the persistent volumes so that the containers can write data into it.

By default, the chart is configured to use Kubernetes Security Context to automatically change the ownership of the volume. However, this feature does not work in all Kubernetes distributions. As an alternative, this chart supports using an initContainer to change the ownership of the volume before mounting it in the final destination.

You can enable this initContainer by setting volumePermissions.enabled to true. There are K8s distribution, such as OpenShift, where you can dynamically define the UID to run this initContainer. To do so, set the volumePermissions.securityContext.runAsUser to auto.

Parameters

Global parameters
NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.defaultStorageClassGlobal default StorageClass for Persistent Volume(s)""
global.storageClassDEPRECATED: use global.defaultStorageClass instead""
global.security.allowInsecureImagesAllows skipping image verificationfalse
global.compatibility.openshift.adaptSecurityContextAdapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation)auto
Common parameters
NameDescriptionValue
kubeVersionForce target Kubernetes version (using Helm capabilities if not set)""
nameOverrideString to partially override influxdb.fullname template with a string (will prepend the release name)""
fullnameOverrideString to fully override influxdb.fullname template with a string""
clusterDomainDefault Kubernetes cluster domaincluster.local
commonAnnotationsAnnotations to add to all deployed objects{}
commonLabelsLabels to add to all deployed objects{}
extraDeployArray of extra objects to deploy with the release[]
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the deployment["sleep"]
diagnosticMode.argsArgs to override all containers in the deployment["infinity"]
InfluxDB™ parameters
NameDescriptionValue
image.registryInfluxDB™ image registryREGISTRY_NAME
image.repositoryInfluxDB™ image repositoryREPOSITORY_NAME/influxdb
image.digestInfluxDB™ image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag""
image.pullPolicyInfluxDB™ image pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[]
image.debugSpecify if debug logs should be enabledfalse
auth.enabledEnable/disable authentication (Variable to keep compatibility with InfluxDB™ v1, in v2 it will be ignored)true
auth.usePasswordFilesWhether to use files to provide secrets instead of env vars.false
auth.admin.usernameInfluxDB™ admin user nameadmin
auth.admin.passwordInfluxDB™ admin user's password""
auth.admin.tokenInfluxDB™ admin user's token. Only valid with InfluxDB™ v2""
auth.admin.orgInfluxDB™ admin user's org. Only valid with InfluxDB™ v2primary
auth.admin.bucketInfluxDB™ admin user's bucket. Only valid with InfluxDB™ v2primary
auth.admin.retentionInfluxDB™ admin user's bucket retention. Only valid with InfluxDB™ v2""
auth.createUserTokenWhether to create tokens for the different users. Take into account these tokens are going to be created by CLI randomly and they will not be accessible from a secret. See more influxdb 2.0 auth reffalse
auth.user.usernameName for InfluxDB™ user with 'admin' privileges on the bucket specified at auth.user.bucket and auth.user.org or auth.admin.org""
auth.user.passwordInfluxDB™ password for user.name user""
auth.user.orgOrg to be created on first run""
auth.user.bucketBucket to be created on first run""
auth.readUser.usernameName for InfluxDB™ user with 'read' privileges on the bucket spe

Note: the README for this chart is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at https://github.com/bitnami/charts/blob/main/bitnami/influxdb/README.md

Docker Pull Command

docker pull bitnamicharts/influxdb
Bitnami