Skip to content

Commit 1e0f2c4

Browse files
author
Vaughn Dice
authored
Merge pull request #169 from deis/add-influxdb-grafana-persistence
feat(charts): add optional persistence storage to influxdb and grafana
2 parents 167e26f + 287dd60 commit 1e0f2c4

7 files changed

Lines changed: 68 additions & 6 deletions

File tree

charts/monitor/charts/grafana/templates/monitor-grafana-deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,13 @@ spec:
7171
ports:
7272
- containerPort: 3500
7373
name: ui
74+
{{- if .Values.persistence.enabled }}
75+
volumeMounts:
76+
- name: grafana-data
77+
mountPath: /var/lib/grafana
78+
volumes:
79+
- name: grafana-data
80+
persistentVolumeClaim:
81+
claimName: deis-monitor-grafana
82+
{{- end }}
7483
{{- end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.persistence.enabled }}
2+
kind: PersistentVolumeClaim
3+
apiVersion: v1
4+
metadata:
5+
name: deis-monitor-grafana
6+
labels:
7+
heritage: deis
8+
annotations:
9+
volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass }}
10+
spec:
11+
accessModes:
12+
- {{ .Values.persistence.accessMode | quote }}
13+
resources:
14+
requests:
15+
storage: {{ .Values.persistence.size | quote }}
16+
{{- end }}

charts/monitor/charts/influxdb/templates/monitor-influxdb-deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,16 @@ spec:
5454
port: 8086
5555
initialDelaySeconds: 1
5656
timeoutSeconds: 1
57+
{{- if .Values.persistence.enabled }}
58+
volumeMounts:
59+
- name: influxdb-data
60+
mountPath: /data
61+
# Allow user influxdb to write to /data
62+
securityContext:
63+
fsGroup: 1001
64+
volumes:
65+
- name: influxdb-data
66+
persistentVolumeClaim:
67+
claimName: deis-monitor-influxdb
68+
{{- end }}
5769
{{- end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.persistence.enabled }}
2+
kind: PersistentVolumeClaim
3+
apiVersion: v1
4+
metadata:
5+
name: deis-monitor-influxdb
6+
labels:
7+
heritage: deis
8+
annotations:
9+
volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass }}
10+
spec:
11+
accessModes:
12+
- {{ .Values.persistence.accessMode | quote }}
13+
resources:
14+
requests:
15+
storage: {{ .Values.persistence.size | quote }}
16+
{{- end }}

charts/monitor/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ grafana:
44
docker_tag: canary
55
# limits_cpu: "100m"
66
# limits_memory: "50Mi"
7+
persistence:
8+
enabled: false
9+
storageClass: standard
10+
accessMode: ReadWriteOnce
11+
size: 5Gi
712
influxdb:
813
org: "deisci"
914
pull_policy: "Always"
@@ -14,6 +19,11 @@ influxdb:
1419
database: "kubernetes"
1520
user: "user"
1621
password: "password"
22+
persistence:
23+
enabled: false
24+
storageClass: standard
25+
accessMode: ReadWriteOnce
26+
size: 20Gi
1727
telegraf:
1828
org: "deisci"
1929
pull_policy: "Always"

influxdb/rootfs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COPY . /
1111

1212
RUN curl -SL -o /home/influxdb/envtpl https://github.com/arschles/envtpl/releases/download/0.2.3/envtpl_linux_amd64 \
1313
&& chmod +x /home/influxdb/envtpl \
14-
&& curl -SL -o /tmp/influxdb.deb https://dl.influxdata.com/influxdb/releases/influxdb_1.0.0_amd64.deb \
14+
&& curl -SL -o /tmp/influxdb.deb https://dl.influxdata.com/influxdb/releases/influxdb_1.1.1_amd64.deb \
1515
&& dpkg -i /tmp/influxdb.deb \
1616
&& rm /tmp/influxdb.deb \
1717
&& mkdir -p /data \

influxdb/rootfs/home/influxdb/config.toml.tpl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ bind-address = {{ default ":8088" .BIND_ADDRESS | quote }}
3535
wal-flush-cold-interval = {{ default "5s" .DATA_WAL_FLUSH_COLD_INTERVAL | quote }}
3636
wal-partition-size-threshold = {{ default 52428800 .DATA_WAL_PARTITION_SIZE_THRESHOLD }}
3737
query-log-enabled = {{ default false .DATA_QUERY_LOG_ENABLED }}
38-
cache-max-memory-size = {{ default 524288000 .DATA_CACHE_MAX_MEMORY_SIZE }}
38+
cache-max-memory-size = {{ default 1048576000 .DATA_CACHE_MAX_MEMORY_SIZE }}
3939
cache-snapshot-memory-size = {{ default 26214400 .DATA_CACHE_SNAPSHOT_MEMORY_SIZE }}
40-
cache-snapshot-write-cold-duration = {{ default "1h0m0s" .DATA_CACHE_SNAPSHOT_WRITE_COLD_DURATION | quote }}
41-
compact-full-write-cold-duration = {{ default "24h0m0s" .DATA_COMPACT_FULL_WRITE_COLD_DURATION | quote }}
40+
cache-snapshot-write-cold-duration = {{ default "10m0s" .DATA_CACHE_SNAPSHOT_WRITE_COLD_DURATION | quote }}
41+
compact-full-write-cold-duration = {{ default "4h0m0s" .DATA_COMPACT_FULL_WRITE_COLD_DURATION | quote }}
4242
max-points-per-block = {{ default 0 .DATA_MAX_POINTS_PER_BLOCK }}
4343
data-logging-enabled = {{ default false .DATA_LOGGING_ENABLED }}
4444

@@ -58,7 +58,7 @@ bind-address = {{ default ":8088" .BIND_ADDRESS | quote }}
5858
advance-period = {{ default "30m0s" .SHARD_PRECREATION_ADVANCE_PERIOD | quote }}
5959

6060
[admin]
61-
enabled = {{ default true .ADMIN_ENABLED }}
61+
enabled = {{ default false .ADMIN_ENABLED }}
6262
bind-address = {{ default ":8083" .ADMIN_BIND_ADDRESS | quote }}
6363
https-enabled = {{ default false .ADMIN_HTTPS_ENABLED }}
6464
https-certificate = {{ default "/etc/ssl/influxdb.pem" .ADMIN_HTTPS_CERTIFICATE | quote }}
@@ -114,4 +114,3 @@ bind-address = {{ default ":8088" .BIND_ADDRESS | quote }}
114114
batch-timeout = {{ default "1s" .UDP_BATCH_TIMEOUT | quote }}
115115
batch-pending = {{ default "5" .UDP_BATCH_PENDING }}
116116
read-buffer ={{ default "0" .UDP_READ_BUFFER }}
117-

0 commit comments

Comments
 (0)