Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/graphite]: allow customizing of statsd configurations. (#7352)
Browse files Browse the repository at this point in the history
* [stable/graphite]: fix indentation of resources block.

* [stable/graphite]: fix indentation of probe blocks.

* [stable/graphite]: allow custom statsd configurations.

* [stable/graphite]: bump chart version.

* [stable/graphite]: configure statsd server interface.

Signed-off-by: Shai Katz <shai@soluto.com>
  • Loading branch information
niclic authored and Shai Katz committed Aug 28, 2018
1 parent 194f5da commit d9d7f89
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 16 deletions.
2 changes: 1 addition & 1 deletion stable/graphite/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
version: 0.1.0
version: 0.1.1
appVersion: "1.1.3"
description: Graphite metrics server
name: graphite
Expand Down
4 changes: 3 additions & 1 deletion stable/graphite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ The following table lists the configurable parameters of the Graphite chart and
| `nodeSelector` | NodeSelector | `{}` |
| `tolerations` | Tolerations | `[]` |
| `affinity` | Affinity | `{}` |
| `configMaps` | All Config files | see values.yaml |
| `configMaps` | Graphite Config files | see values.yaml |
| `statsdConfigMaps` | StatsD Config files | see values.yaml |
| `statsd.interface` | StatsD server interface, `TCP` or `UDP` | `UDP` |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
Expand Down
36 changes: 23 additions & 13 deletions stable/graphite/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,47 @@ spec:
- name: aggregate-pickl
containerPort: 2024
- name: statsd
protocol: {{ .Values.statsd.interface }}
containerPort: 8125
- name: statsd-admin
containerPort: 8126
livenessProbe:
httpGet:
path: /
port: graphite-gui
readinessProbe:
httpGet:
path: /
port: graphite-gui
resources:
env:
- name: "STATSD_INTERFACE"
value: {{ .Values.statsd.interface | lower }}
livenessProbe:
httpGet:
path: /
port: graphite-gui
readinessProbe:
httpGet:
path: /
port: graphite-gui
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: {{ template "graphite.fullname" . }}-configmap
mountPath: /opt/graphite/conf/
- name: {{ template "graphite.fullname" . }}-statsd-configmap
subPath: config_tcp.js
mountPath: /opt/statsd/config_tcp.js
- name: {{ template "graphite.fullname" . }}-statsd-configmap
subPath: config_udp.js
mountPath: /opt/statsd/config_udp.js
- name: {{ template "graphite.fullname" . }}-pvc
mountPath: /opt/graphite/storage/
volumes:
- name: {{ template "graphite.fullname" . }}-configmap
configMap:
name: {{ template "graphite.fullname" . }}-configmap
- name: {{ template "graphite.fullname" . }}-statsd-configmap
configMap:
name: {{ template "graphite.fullname" . }}-statsd-configmap
- name: {{ template "graphite.fullname" . }}-pvc
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "graphite.fullname" . }}-pvc{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.resources }}
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
2 changes: 1 addition & 1 deletion stable/graphite/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
protocol: TCP
- name: statsd
port: 8125
protocol: TCP
protocol: {{ .Values.statsd.interface }}
- name: statsd-admin
port: 8126
protocol: TCP
Expand Down
14 changes: 14 additions & 0 deletions stable/graphite/templates/statsd-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "graphite.fullname" . }}-statsd-configmap
labels:
app: {{ template "graphite.name" . }}
chart: {{ template "graphite.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{- range $key, $value := .Values.statsdConfigMaps }}
{{ $key }}: |-
{{ $value | indent 4 }}
{{- end }}
29 changes: 29 additions & 0 deletions stable/graphite/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -992,3 +992,32 @@ configMaps:
# missing, all metrics will pass through.
# This file is reloaded automatically when changes are made
.*
statsdConfigMaps:
config_tcp.js: |-
{
"graphiteHost": "127.0.0.1",
"graphitePort": 2003,
"port": 8125,
"flushInterval": 10000,
"servers": [{
"server": "./servers/tcp",
"address": "0.0.0.0",
"port": 8125
}]
}
config_udp.js: |-
{
"graphiteHost": "127.0.0.1",
"graphitePort": 2003,
"port": 8125,
"flushInterval": 10000,
"servers": [{
"server": "./servers/udp",
"address": "0.0.0.0",
"port": 8125
}]
}
statsd:
interface: UDP

0 comments on commit d9d7f89

Please sign in to comment.