Skip to content

Commit dbef0d1

Browse files
committed
opentsdb chart
1 parent b867039 commit dbef0d1

15 files changed

+421
-0
lines changed

charts/opentsdb/.helmignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj

charts/opentsdb/Chart.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
appVersion: "2.3.1"
3+
description: >
4+
Store and serve massive amounts of time series data without losing
5+
granularity.
6+
home: http://opentsdb.net/
7+
icon: http://opentsdb.net/img/logo_header.png
8+
maintainers:
9+
10+
name: cgiraldo
11+
name: opentsdb
12+
version: 0.1.0

charts/opentsdb/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
opentsdb
2+
========
3+
Store and serve massive amounts of time series data without losing granularity.
4+
5+
6+
Current chart version is `0.1.0`
7+
8+
Source code can be found [here](http://opentsdb.net/)
9+
10+
11+
## Installing the Chart
12+
13+
Add gradiant helm repo:
14+
15+
```
16+
helm repo add gradiant https://gradiant.github.io/charts
17+
```
18+
19+
To install the chart with the release name `opentsdb`.
20+
21+
```
22+
$ helm install --name opentsdb gradiant/opentsdb
23+
```
24+
25+
## Chart Requirements
26+
27+
| Repository | Name | Version |
28+
|------------|------|---------|
29+
| https://gradiant.github.io/charts | hbase | ~0.1.0 |
30+
31+
## Chart Values
32+
33+
| Key | Type | Default | Description |
34+
|-----|------|---------|-------------|
35+
| antiAffinity | string | `"soft"` | |
36+
| conf."tsd.core.auto_create_metrics" | bool | `true` | |
37+
| conf."tsd.core.auto_create_tagks" | bool | `true` | |
38+
| conf."tsd.core.auto_create_tagvs" | bool | `true` | |
39+
| conf."tsd.storage.hbase.zk_quorum" | string | `nil` | |
40+
| daemons | int | `1` | |
41+
| hbase.enabled | bool | `true` | |
42+
| hbaseConfigMapName | string | `nil` | |
43+
| hbaseImage.repository | string | `"gradiant/hbase-base"` | |
44+
| hbaseImage.tag | string | `"2.0.1"` | |
45+
| image.pullPolicy | string | `"IfNotPresent"` | |
46+
| image.repository | string | `"gradiant/opentsdb"` | |
47+
| image.tag | string | `"2.4.0"` | |
48+
| nodePort.enabled | bool | `false` | |
49+
| nodePort.externalPort | int | `31042` | |
50+
| port | int | `4242` | |
51+
| resources.limits.cpu | string | `"1000m"` | |
52+
| resources.limits.memory | string | `"2048Mi"` | |
53+
| resources.requests.cpu | string | `"10m"` | |
54+
| resources.requests.memory | string | `"256Mi"` | |

charts/opentsdb/requirements.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependencies:
2+
- name: hbase
3+
version: ~0.1.0
4+
repository: https://gradiant.github.io/charts
5+
condition: hbase.enabled
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/sh
2+
set -e
3+
COMPRESSION=GZ
4+
# Small script to setup the HBase tables used by OpenTSDB.
5+
test -n "$HBASE_PREFIX" || {
6+
echo >&2 'The environment variable HBASE_PREFIX must be set'
7+
exit 1
8+
}
9+
test -d "$HBASE_PREFIX" || {
10+
echo >&2 "No such directory: HBASE_PREFIX=$HBASE_PREFIX"
11+
exit 1
12+
}
13+
cp /tmp/hbase-config/* $HBASE_PREFIX/conf/
14+
15+
TSDB_TABLE=${TSDB_TABLE-'tsdb'}
16+
UID_TABLE=${UID_TABLE-'tsdb-uid'}
17+
TREE_TABLE=${TREE_TABLE-'tsdb-tree'}
18+
META_TABLE=${META_TABLE-'tsdb-meta'}
19+
BLOOMFILTER=${BLOOMFILTER-'ROW'}
20+
# LZO requires lzo2 64bit to be installed + the hadoop-gpl-compression jar.
21+
COMPRESSION=${COMPRESSION-'LZO'}
22+
# All compression codec names are upper case (NONE, LZO, SNAPPY, etc).
23+
COMPRESSION=`echo "$COMPRESSION" | tr a-z A-Z`
24+
25+
case $COMPRESSION in
26+
(NONE|LZO|GZIP|SNAPPY) :;; # Known good.
27+
(*)
28+
echo >&2 "warning: compression codec '$COMPRESSION' might not be supported."
29+
;;
30+
esac
31+
echo "checking if opentsdb $UID_TABLE hbase table exists"
32+
ret=$( echo "exists '$UID_TABLE'" | $HBASE_PREFIX/bin/hbase shell -n )
33+
if [[ $ret == *"true"* ]];
34+
then
35+
echo "OpenTSDB tables already created."
36+
exit 0
37+
else
38+
echo "Creating OpenTSDB hbase tables:"
39+
$HBASE_PREFIX/bin/hbase shell -n << EOF
40+
create '$UID_TABLE',
41+
{NAME => 'id', COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'},
42+
{NAME => 'name', COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'}
43+
44+
create '$TSDB_TABLE',
45+
{NAME => 't', VERSIONS => 1, COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'}
46+
47+
create '$TREE_TABLE',
48+
{NAME => 't', VERSIONS => 1, COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'}
49+
50+
create '$META_TABLE',
51+
{NAME => 'name', COMPRESSION => '$COMPRESSION', BLOOMFILTER => '$BLOOMFILTER'}
52+
EOF
53+
echo "DONE"
54+
fi
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# --------- NETWORK ----------
2+
# The TCP port TSD should use for communications
3+
# *** REQUIRED ***
4+
tsd.network.port={{ .Values.port }}
5+
# ----------- HTTP -----------
6+
# The location of static files for the HTTP GUI interface.
7+
# *** REQUIRED ***
8+
tsd.http.staticroot = /usr/share/opentsdb/static/
9+
# Where TSD should write it's cache files to
10+
# *** REQUIRED ***
11+
tsd.http.cachedir = /tmp/opentsdb
12+
{{- if not (index .Values.conf "tsd.storage.hbase.zk_quorum") }}
13+
tsd.storage.hbase.zk_quorum = {{ .Release.Name }}-zookeeper:2181
14+
{{- end }}
15+
{{- range $key, $value := .Values.conf }}
16+
{{- if $value }}
17+
{{ $key }} = {{ $value }}
18+
{{- end}}
19+
{{- end }}

charts/opentsdb/templates/NOTES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
1. You can open access opentsdb CLI by running this command:
2+
kubectl -n {{ .Release.Namespace }} exec -ti {{ include "opentsdb.fullname" . }}-0 -- tsdb version
3+
4+
2. Get description of opentsdb service:
5+
kubectl -n {{ .Release.Namespace }} describe service {{ include "opentsdb.fullname" . }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "opentsdb.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
*/}}
13+
{{- define "opentsdb.fullname" -}}
14+
{{- if .Values.fullnameOverride -}}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
16+
{{- else -}}
17+
{{- $name := default .Chart.Name .Values.nameOverride -}}
18+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
19+
{{- end -}}
20+
{{- end -}}
21+
22+
{{/*
23+
Standard Labels from Helm documentation https://helm.sh/docs/chart_best_practices/#labels-and-annotations
24+
*/}}
25+
26+
{{- define "opentsdb.labels" -}}
27+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
28+
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
29+
app.kubernetes.io/instance: {{ .Release.Name | quote }}
30+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
31+
app.kubernetes.io/part-of: {{ .Chart.Name }}
32+
{{- end -}}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- if .Values.nodePort.enabled }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ include "opentsdb.fullname" . }}-nodeport
6+
labels:
7+
app.kubernetes.io/name: {{ include "opentsdb.name" . }}
8+
{{- include "opentsdb.labels" . | nindent 4 }}
9+
spec:
10+
type: NodePort
11+
ports:
12+
- name: external-daemon
13+
port: {{ .Values.port }}
14+
targetPort: {{ .Values.port }}
15+
nodePort: {{ .Values.nodePort.externalPort }}
16+
protocol: TCP
17+
selector:
18+
app.kubernetes.io/name: {{ include "opentsdb.name" . }}
19+
app.kubernetes.io/instance: {{ .Release.Name }}
20+
{{- end }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "opentsdb.fullname" . }}
5+
labels:
6+
app.kubernetes.io/name: {{ include "opentsdb.name" . }}
7+
{{- include "opentsdb.labels" . | nindent 4 }}
8+
data:
9+
opentsdb.conf: |-
10+
{{ tpl (.Files.Get "resources/config/opentsdb.conf") . | indent 4 }}

0 commit comments

Comments
 (0)