Back to Charts

DEPRECATED - InfluxDB

stable/influxdb/README.md

latest12.4 KB
Original Source

DEPRECATED - InfluxDB

This chart has been deprecated and moved to its new home:

An Open-Source Time Series Database

InfluxDB is an open source time series database built by the folks over at InfluxData with no external dependencies. It's useful for recording metrics, events, and performing analytics.

QuickStart

bash
$ helm install stable/influxdb --name foo --namespace bar

Introduction

This chart bootstraps an InfluxDB statefulset and service on a Kubernetes cluster using the Helm Package manager.

Prerequisites

  • Kubernetes 1.4+
  • PV provisioner support in the underlying infrastructure (optional)

Installing the Chart

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

bash
$ helm install --name my-release stable/influxdb

The command deploys InfluxDB on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

bash
$ helm delete my-release --purge

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The default configuration values for this chart are listed in values.yaml.

General

ParameterDescriptionDefault
image.repositoryImage repository urlinfluxdb
image.tagImage tag1.7.6-alpine
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsIt will store the repository's credentials to pull imagenil
serviceAccount.createIt will create service accounttrue
serviceAccount.nameService account name""
serviceAccount.annotationsService account annotations{}
livenessProbeHealth check for pod{}
readinessProbeHealth check for pod{}
startupProbeHealth check for pod{}
service.typeKubernetes service typeClusterIP
persistence.enabledBoolean to enable and disable persistancetrue
persistence.storageClassIf set to "-", storageClassName: "", which disables dynamic provisioning. If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner. (gp2 on AWS, standard on GKE, AWS & OpenStack
persistence.annotationsAnnotations for volumeClaimTemplatesnil
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeStorage size8Gi
podAnnotationsAnnotations for pod{}
ingress.enabledBoolean flag to enable or disable ingressfalse
ingress.tlsBoolean to enable or disable tls for ingress. If enabled provide a secret in ingress.secretName containing TLS private key and certificate.false
ingress.secretNameKubernetes secret containing TLS private key and certificate. It is only required if ingress.tls is enabled.nil
ingress.hostnameHostname for the ingressinfluxdb.foobar.com
annotationsingress annotationsnil
schedulerNameUse an alternate scheduler, e.g. "stork".nil
nodeSelectorNode labels for pod assignment{}
affinityAffinity for pod assignment{
tolerationsTolerations for pod assignment[]
envenvironment variables for influxdb container{}
config.reporting_disabledDetailsfalse
config.rpcRPC address for backup and storage{}
config.metaDetails{}
config.dataDetails{}
config.coordinatorDetails{}
config.retentionDetails{}
config.shard_precreationDetails{}
config.monitorDetails{}
config.httpDetails{}
config.loggingDetails{}
config.subscriberDetails{}
config.graphiteDetails{}
config.collectdDetails{}
config.opentsdbDetails{}
config.udpDetails{}
config.continous_queriesDetails{}
config.tlsDetails{}
initScripts.enabledBoolean flag to enable and disable initscripts. If the container finds any files with the extensions .sh or .iql inside of the /docker-entrypoint-initdb.d folder, it will execute them. The order they are executed in is determined by the shell. This is usually alphabetical order.false
initScripts.scriptsInit scripts{}
backup.enabledBoolean flag to enable and disable backups. Currently, it backups the data on azure and gcs.false
backup.scheduleCron time0 0 * * *. It means create a backup everyday at 00:00.
backup.annotationsAnnotations for backup{}

The full image documentation contains more information about running InfluxDB in docker.

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

bash
$ helm install --name my-release \
  --set persistence.enabled=true,persistence.size=200Gi \
    stable/influxdb

The above command enables persistence and changes the size of the requested data volume to 200GB.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

bash
$ helm install --name my-release -f values.yaml stable/influxdb

Tip: You can use the default values.yaml

Enterprise

InfluxDB Enterprise is a hardened version of the open source core InfluxDB that includes additional closed source features designed for production workloads, featuring high availability and horizontal scaling. InfluxDB Enterprise features require a InfluxDB Enterprise license.

Configuration

To enable InfluxDB Enterprise, set the following keys and values in a values file provided to Helm.

KeyDescriptionRecommended value
livenessProbe.initalDelaySecondsUsed to allow enough time to join meta nodes to a cluster3600
image.tagSet to a data image. See https://hub.docker.com/_/influxdb for detailsdata
service.ClusterIPUse a headless service for StatefulSets"None"
env.name[_HOSTNAME]Used to provide a unique name.service for InfluxDB. See values.yaml for an examplevalueFrom.fieldRef.fieldPath: metadata.name
enterprise.enabledCreate StatefulSets for use with influx-data and influx-meta imagestrue
enterprise.licensekeyLicense for InfluxDB Enterprise
enterprise.clusterSizeReplicas for influx StatefulSetDependent on license
enterprise.meta.image.tagSet to an meta image. See https://hub.docker.com/_/influxdb for detailsmeta
enterprise.meta.clusterSizeReplicas for influxdb-meta StatefulSet.3
enterprise.meta.resourcesResources requests and limits for meta influxdb-meta podsSee values.yaml

Join pods to InfluxDB Enterprise cluster

Meta and data pods need to be joined together using the command influxd-ctl found on meta pods. It is recommended you run influxd-ctl on one and only one meta pod, and to join meta pods together before data pods. For each meta pod, run influxd-ctl. With default settings it should look something like this:

shell
kubectl exec influxdb-meta-0 influxd-ctl add-meta influxdb-meta-0.influxdb-meta:8091

From the same meta pod, for each data pod, run influxd-ctl. With default settings it should look something like this:

shell
kubectl exec influxdb-meta-0 influxd-ctl add-data influxdb-0.influxdb:8088

When using influxd-ctl be sure to use the appropriate DNS name for your pods, following the naming scheme of pod.service. In the above examples, the pod names were influxdb-meta-0 and influxdb-0 respectively, and the service name was influxdb

Persistence

The InfluxDB image stores data in the /var/lib/influxdb directory in the container.

If persistence is enabled, a Persistent Volume associated with Statefulset will be provisioned. The volume is created using dynamic volume provisioning. In case of a disruption e.g. a node drain, kubernetes ensures that the same volume will be reatached to the Pod, preventing any data loss. Althought, when persistence is not enabled, InfluxDB data will be stored in an empty directory thus, in a Pod restart, data will be lost.

Starting with authentication

In values.yaml change .Values.config.http.auth_enabled to true.

Influxdb requires also a user to be set in order for authentication to be enforced. See more details here.

To handle this setup on startup, a job can be enabled in values.yaml by setting .Values.setDefaultUser.enabled to true.

Make sure to uncomment or configure the job settings after enabling it. If a password is not set, a random password will be generated.

Alternatively, if .Values.setDefaultUser.user.existingSecret is set the user and password are obtained from an existing Secret, the expected keys are influxdb-user and influxdb-password. Use this variable if you need to check in the values.yaml in a repository to avoid exposing your secrets.

Upgrading

From < 1.0.0 To >= 1.0.0

Values .Values.config.bind_address and .Values.exposeRpc no longer exist. They have been replaced with .Values.config.rpc.bind_address and .Values.config.rpc.enabled respectively. Please adjust your values file accordingly.

From < 1.5.0 to >= 2.0.0

The Kubernetes API change to support 1.160 may not be backwards compatible and may require the chart to be uninstalled in order to upgrade. See this issue for some background.

From < 3.0.0 to >= 3.0.0

Since version 3.0.0 this chart uses a StatefulSet instead of a Deployment. As part of this update the existing persistent volume (and all data) is deleted and a new one is created. Make sure to backup and restore the data manually.

From < 4.0.0 to >= 4.0.0

Labels are changed to those in accordance with kubernetes recommended labels. This change also removes the ability to configure clusterIP value as to avoid Error: UPGRADE FAILED: failed to replace object: Service "my-influxdb" is invalid: spec.clusterIP: Invalid value: "": field is immutable type errors. For more info on this error and why it should be avoided at all costs, please see this github issue.

Due to the significance of the changes. The recommended approach is to uninstall and reinstall the chart (the PVC should not be deleted during this process, but it is highly recommended to backup your data before).