Commit 4affe5d0 authored by Jack Zampolin's avatar Jack Zampolin Committed by Lachlan Evenson

Chart for InfluxDB (#259)

* Add influxdb chart * Add NOTES.txt, update README.md and fix helm lint warnings * Fix Typo * Add labels to pvc * Add descriptiveness for InfluxDB config * Address PR comments * NodePort -> ClusterIP and remove values.yaml from README.md
parent 32b403d0
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
name: influxdb
version: 0.1.0
description: Chart for InfluxDB
keywords:
- influxdb
- database
- timeseries
home: https://www.influxdata.com/time-series-platform/influxdb/
maintainers:
- name: Jack Zampolin
email: jack@influxdb.com
engine: gotpl
# InfluxDB
## An Open-Source Time Series Database
[InfluxDB](https://github.com/influxdata/influxdb) is an open source time series database built by the folks over at [InfluxData](https://influxdata.com) 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 deployment 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](#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`.
The [full image documentation](https://hub.docker.com/_/influxdb/) 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](values.yaml)
## Persistence
The [InfluxDB](https://hub.docker.com/_/influxdb/) image stores data in the `/var/lib/influxdb` directory in the container.
The chart mounts a [Persistent Volume](kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning.
InfluxDB can be accessed via port {{ .Values.config.http.bind_address }} on the following DNS name from within your cluster:
- http://{{ template "fullname" . }}.{{ .Release.Namespace }}:{{ .Values.config.http.bind_address }}
You can easily connect to the remote instance with your local influx cli. To forward the API port to localhost:8086 run the following:
- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8086:{{ .Values.config.http.bind_address }}
You can also connect to the influx cli from inside the container. To open a shell session in the InfluxDB pod run the following:
- kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh
To tail the logs for the InfluxDB pod run the following:
- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }')
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
influxdb.conf: |+
reporting-disabled = {{ .Values.config.reporting_disabled | default false }}
bind-address = ":{{ .Values.config.bind_address }}"
[meta]
dir = "{{ .Values.config.storage_directory }}/meta"
retention-autocreate = {{ .Values.config.meta.retention_autocreate }}
logging-enabled = {{ .Values.config.meta.logging_enabled }}
[data]
dir = "{{ .Values.config.storage_directory }}/data"
wal-dir = "{{ .Values.config.storage_directory }}/wal"
query-log-enabled = {{ .Values.config.data.query_log_enabled }}
cache-max-memory-size = {{ .Values.config.data.cache_max_memory_size | int64 }}
cache-snapshot-memory-size = {{ .Values.config.data.cache_snapshot_memory_size | int64 }}
cache-snapshot-write-cold-duration = "{{ .Values.config.data.cache_snapshot_write_cold_duration }}"
compact-full-write-cold-duration = "{{ .Values.config.data.compact_full_write_cold_duration }}"
max-series-per-database = {{ .Values.config.data.max_series_per_database | int64 }}
max-values-per-tag = {{ .Values.config.data.max_values_per_tag | int64 }}
trace-logging-enabled = {{ .Values.config.data.trace_logging_enabled }}
[coordinator]
write-timeout = "{{ .Values.config.coordinator.write_timeout }}"
max-concurrent-queries = {{ .Values.config.coordinator.max_concurrent_queries | int64 }}
query-timeout = "{{ .Values.config.coordinator.query_timeout }}"
log-queries-after = "{{ .Values.config.coordinator.log_queries_after }}"
max-select-point = {{ .Values.config.coordinator.max_select_point | int64 }}
max-select-series = {{ .Values.config.coordinator.max_select_series | int64 }}
max-select-buckets = {{ .Values.config.coordinator.max_select_buckets | int64 }}
[retention]
enabled = {{ .Values.config.retention.enabled }}
check-interval = "{{ .Values.config.retention.check_interval }}"
[shard-precreation]
enabled = {{ .Values.config.shard_precreation.enabled }}
check-interval = "{{ .Values.config.shard_precreation.check_interval }}"
advance-period = "{{ .Values.config.shard_precreation.advance_period }}"
[admin]
enabled = {{ .Values.config.admin.enabled }}
bind-address = ":{{ .Values.config.admin.bind_address }}"
https-enabled = {{ .Values.config.admin.https_enabled }}
https-certificate = "{{ .Values.config.admin.https_certificate }}"
[monitor]
store-enabled = {{ .Values.config.monitor.store_enabled }}
store-database = "{{ .Values.config.monitor.store_database }}"
store-interval = "{{ .Values.config.monitor.store_interval }}"
[subscriber]
enabled = {{ .Values.config.subscriber.enabled }}
http-timeout = "{{ .Values.config.subscriber.http_timeout }}"
insecure-skip-verify = {{ .Values.config.subscriber.insecure_skip_verify }}
ca-certs = "{{ .Values.config.subscriber.ca_certs }}"
write-concurrency = {{ .Values.config.subscriber.write_concurrency | int64 }}
write-buffer-size = {{ .Values.config.subscriber.write_buffer_size | int64 }}
[http]
enabled = {{ .Values.config.http.enabled }}
bind-address = ":{{ .Values.config.http.bind_address }}"
auth-enabled = {{ .Values.config.http.auth_enabled }}
log-enabled = {{ .Values.config.http.log_enabled }}
write-tracing = {{ .Values.config.http.write_tracing }}
pprof-enabled = {{ .Values.config.http.pprof_enabled }}
https-enabled = {{ .Values.config.http.https_enabled }}
https-certificate = "{{ .Values.config.http.https_certificate }}"
https-private-key = "{{ .Values.config.http.https_private_key }}"
max-row-limit = {{ .Values.config.http.max_row_limit | int64 }}
max-connection-limit = {{ .Values.config.http.max_connection_limit | int64 }}
shared-secret = "{{ .Values.config.http.shared_secret }}"
realm = "{{ .Values.config.http.realm }}"
unix-socket-enabled = {{ .Values.config.http.unix_socket_enabled }}
bind-socket = "{{ .Values.config.http.bind_socket }}"
# TODO: allow multiple graphite listeners with templates
[[graphite]]
enabled = {{ .Values.config.graphite.enabled }}
bind-address = ":{{ .Values.config.graphite.bind_address }}"
database = "{{ .Values.config.graphite.database }}"
retention-policy = "{{ .Values.config.graphite.retention_policy }}"
protocol = "{{ .Values.config.graphite.protocol }}"
batch-size = {{ .Values.config.graphite.batch_size | int64 }}
batch-pending = {{ .Values.config.graphite.batch_pending | int64 }}
batch-timeout = "{{ .Values.config.graphite.batch_timeout }}"
consistency-level = "{{ .Values.config.graphite.consistency_level }}"
separator = "{{ .Values.config.graphite.separator }}"
udp-read-buffer = {{ .Values.config.graphite.udp_read_buffer | int64 }}
# TODO: allow multiple collectd listeners with templates
[[collectd]]
enabled = {{ .Values.config.collectd.enabled }}
bind-address = ":{{ .Values.config.collectd.bind_address }}"
database = "{{ .Values.config.collectd.database }}"
retention-policy = "{{ .Values.config.collectd.retention_policy }}"
batch-size = {{ .Values.config.collectd.batch_size | int64 }}
batch-pending = {{ .Values.config.collectd.batch_pending | int64 }}
batch-timeout = "{{ .Values.config.collectd.batch_timeout }}"
read-buffer = {{ .Values.config.collectd.read_buffer | int64 }}
typesdb = "{{ .Values.config.collectd.typesdb }}"
security-level = "{{ .Values.config.collectd.security_level }}"
auth-file = "{{ .Values.config.collectd.auth_file }}"
# TODO: allow multiple opentsdb listeners with templates
[[opentsdb]]
enabled = {{ .Values.config.opentsdb.enabled }}
bind-address = ":{{ .Values.config.opentsdb.bind_address }}"
database = "{{ .Values.config.opentsdb.database }}"
retention-policy = "{{ .Values.config.opentsdb.retention_policy }}"
consistency-level = "{{ .Values.config.opentsdb.consistency_level }}"
tls-enabled = {{ .Values.config.opentsdb.tls_enabled }}
certificate = "{{ .Values.config.opentsdb.certificate }}"
batch-size = {{ .Values.config.opentsdb.batch_size | int64 }}
batch-pending = {{ .Values.config.opentsdb.batch_pending | int64 }}
batch-timeout = "{{ .Values.config.opentsdb.batch_timeout }}"
log-point-errors = {{ .Values.config.opentsdb.log_point_errors }}
# TODO: allow multiple udp listeners with templates
[[udp]]
enabled = {{ .Values.config.udp.enabled }}
bind-address = ":{{ .Values.config.udp.bind_address }}"
database = "{{ .Values.config.udp.database }}"
retention-policy = "{{ .Values.config.udp.retention_policy }}"
batch-size = {{ .Values.config.udp.batch_size | int64 }}
batch-pending = {{ .Values.config.udp.batch_pending | int64 }}
read-buffer = {{ .Values.config.udp.read_buffer | int64 }}
batch-timeout = "{{ .Values.config.udp.batch_timeout }}"
precision = "{{ .Values.config.udp.precision }}"
[continuous_queries]
log-enabled = {{ .Values.config.continuous_queries.log_enabled }}
enabled = {{ .Values.config.continuous_queries.enabled }}
run-interval = "{{ .Values.config.continuous_queries.run_interval }}"
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
replicas: 1
template:
metadata:
labels:
app: {{ template "fullname" . }}
spec:
containers:
- name: {{ template "fullname" . }}
image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
resources:
{{ toYaml .Values.resources | indent 10 }}
ports:
- name: api
containerPort: {{ .Values.config.http.bind_address -}}
{{- if .Values.config.admin.enabled -}}
- name: admin
containerPort: {{ .Values.config.admin.bind_address }}
{{- end }}
{{- if .Values.config.graphite.enabled -}}
- name: graphite
containerPort: {{ .Values.config.graphite.bind_address }}
{{- end }}
{{- if .Values.config.collectd.enabled -}}
- name: collectd
containerPort: {{ .Values.config.collectd.bind_address }}
{{- end }}
{{- if .Values.config.udp.enabled -}}
- name: udp
containerPort: {{ .Values.config.udp.bind_address }}
{{- end }}
{{- if .Values.config.opentsdb.enabled -}}
- name: opentsdb
containerPort: {{ .Values.config.opentsdb.bind_address }}
{{- end }}
livenessProbe:
httpGet:
path: /ping
port: api
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /ping
port: api
initialDelaySeconds: 5
timeoutSeconds: 1
volumeMounts:
- name: data
mountPath: {{ .Values.config.storage_directory }}
- name: config
mountPath: /etc/influxdb
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}
{{- else }}
emptyDir: {}
{{- end }}
- name: config
configMap:
name: {{ template "fullname" . }}
{{- if .Values.persistence.enabled }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
type: {{ .Values.service.type }}
ports:
{{- if .Values.config.http.enabled }}
- name: api
port: {{ .Values.config.http.bind_address }}
targetPort: {{ .Values.config.http.bind_address }}
{{- end }}
{{- if .Values.config.admin.enabled }}
- name: admin
port: {{ .Values.config.admin.bind_address }}
targetPort: {{ .Values.config.admin.bind_address }}
{{- end }}
{{- if .Values.config.graphite.enabled }}
- name: graphite
port: {{ .Values.config.graphite.bind_address }}
targetPort: {{ .Values.config.graphite.bind_address }}
{{- end }}
{{- if .Values.config.collectd.enabled }}
- name: collectd
port: {{ .Values.config.collectd.bind_address }}
targetPort: {{ .Values.config.collectd.bind_address }}
{{- end }}
{{- if .Values.config.udp.enabled }}
- name: udp
port: {{ .Values.config.udp.bind_address }}
targetPort: {{ .Values.config.udp.bind_address }}
{{- end }}
{{- if .Values.config.opentsdb.enabled }}
- name: opentsdb
port: {{ .Values.config.opentsdb.bind_address }}
targetPort: {{ .Values.config.opentsdb.bind_address }}
{{- end }}
selector:
app: {{ template "fullname" . }}
## influxdb image version
## ref: https://hub.docker.com/r/library/influxdb/tags/
image:
repo: "influxdb"
tag: "1.1.0-alpine"
pullPolicy: IfNotPresent
## Specify a service type
## NodePort is default
## ref: http://kubernetes.io/docs/user-guide/services/
service:
type: ClusterIP
## Persist data to a persitent volume
persistence:
enabled: false
storageClass: generic
accessMode: ReadWriteOnce
size: 8Gi
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
resources:
requests:
memory: 256Mi
cpu: 0.1
limits:
memory: 16Gi
cpu: 8
## Change InfluxDB configuration paramaters below:
## Defaults are indicated
## ref: https://docs.influxdata.com/influxdb/v1.1/administration/config/
config:
reporting_disabled: false
bind_address: 8088
storage_directory: /var/lib/influxdb
meta:
retention_autocreate: true
logging_enabled: true
data:
query_log_enabled: true
cache_max_memory_size: 1073741824
cache_snapshot_memory_size: 26214400
cache_snapshot_write_cold_duration: 10m0s
compact_full_write_cold_duration: 4h0m0s
max_series_per_database: 1000000
max_values_per_tag: 100000
trace_logging_enabled: false
coordinator:
write_timeout: 10s
max_concurrent_queries: 0
query_timeout: 0s
log_queries_after: 0s
max_select_point: 0
max_select_series: 0
max_select_buckets: 0
retention:
enabled: true
check_interval: 30m0s
shard_precreation:
enabled: true
check_interval: 10m0s
advance_period: 30m0s
admin:
enabled: false
bind_address: 8083
https_enabled: false
https_certificate: /etc/ssl/influxdb.pem
monitor:
store_enabled: true
store_database: _internal
store_interval: 10s
subscriber:
enabled: true
http_timeout: 30s
insecure_skip_verify: false
ca_certs: ""
write_concurrency: 40
write_buffer_size: 1000
http:
enabled: true
bind_address: 8086
auth_enabled: false
log_enabled: true
write_tracing: false
pprof_enabled: true
https_enabled: false
https_certificate: /etc/ssl/influxdb.pem
https_private_key: ""
max_row_limit: 10000
max_connection_limit: 0
shared_secret: "beetlejuicebeetlejuicebeetlejuice"
realm: InfluxDB
unix_socket_enabled: false
bind_socket: /var/run/influxdb.sock
graphite:
enabled: false
bind_address: 2003
database: graphite
retention_policy: autogen
protocol: tcp
batch_size: 5000
batch_pending: 10
batch_timeout: 1s
consistency_level: one
separator: .
udp_read_buffer: 0
collectd:
enabled: false
bind_address: 25826
database: collectd
retention_policy: autogen
batch_size: 5000
batch_pending: 10
batch_timeout: 10s
read_buffer: 0
typesdb: /usr/share/collectd/types.db
security_level: none
auth_file: /etc/collectd/auth_file
opentsdb:
enabled: false
bind_address: 4242
database: opentsdb
retention_policy: autogen
consistency_level: one
tls_enabled: false
certificate: /etc/ssl/influxdb.pem
batch_size: 1000
batch_pending: 5
batch_timeout: 1s
log_point_errors: true
udp:
enabled: false
bind_address: 8089
database: udp
retention_policy: autogen
batch_size: 5000
batch_pending: 10
read_buffer: 0
batch_timeout: 1s
precision: "ns"
continuous_queries:
log_enabled: true
enabled: true
run_interval: 1s
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment