summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-02-28 03:55:35 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-02-28 03:55:35 +0100
commitf5485b32047f245cb3cc26bb7791c9ee4141048c (patch)
tree61e7fc9f1ab821cdfa0236e842432c02f7802cd7
parentMerge branch 'k8s' of ssh://git-spreadspace@git.spreadspace.org:22000/flufigu... (diff)
added graphite
-rw-r--r--contrib/k8s-emc/graphite-cm-api.yml13
-rw-r--r--contrib/k8s-emc/graphite-cm-carbon.yml55
-rw-r--r--contrib/k8s-emc/graphite-statefulset.yml76
-rw-r--r--contrib/k8s-emc/graphite-svc.yml18
4 files changed, 162 insertions, 0 deletions
diff --git a/contrib/k8s-emc/graphite-cm-api.yml b/contrib/k8s-emc/graphite-cm-api.yml
new file mode 100644
index 0000000..31bccc4
--- /dev/null
+++ b/contrib/k8s-emc/graphite-cm-api.yml
@@ -0,0 +1,13 @@
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ namespace: emc
+ name: stats-graphite-api
+ labels:
+ app: graphite
+ tier: stats
+data:
+ api.yaml: |
+ search_index: /srv/index/index
+ whisper:
+ directories: /srv/data/graphite/whisper
diff --git a/contrib/k8s-emc/graphite-cm-carbon.yml b/contrib/k8s-emc/graphite-cm-carbon.yml
new file mode 100644
index 0000000..7157284
--- /dev/null
+++ b/contrib/k8s-emc/graphite-cm-carbon.yml
@@ -0,0 +1,55 @@
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ namespace: emc
+ name: stats-graphite-carbon
+ labels:
+ app: graphite
+ tier: stats
+data:
+ carbon.conf: |
+ [cache]
+
+ STORAGE_DIR = /srv/data/
+ LOCAL_DATA_DIR = /srv/data/whisper/
+ CONF_DIR = /srv/config/
+
+ MAX_CACHE_SIZE = inf
+ MAX_UPDATES_PER_SECOND = 1000
+ # MAX_UPDATES_PER_SECOND_ON_SHUTDOWN = 5000
+
+ MAX_CREATES_PER_MINUTE = 50
+
+ LINE_RECEIVER_INTERFACE = 0.0.0.0
+ LINE_RECEIVER_PORT = 2003
+
+ ENABLE_UDP_LISTENER = False
+ PICKLE_RECEIVER_PORT = 0
+
+ LOG_LISTENER_CONNECTIONS = True
+
+ CACHE_QUERY_INTERFACE = 127.0.0.1
+ CACHE_QUERY_PORT = 7002
+
+ USE_FLOW_CONTROL = True
+
+ LOG_UPDATES = False
+ LOG_CACHE_HITS = False
+ LOG_CACHE_QUEUE_SORTS = True
+
+ CACHE_WRITE_STRATEGY = sorted
+ WHISPER_AUTOFLUSH = False
+
+ WHISPER_FALLOCATE_CREATE = True
+ storage-schemas.conf: |
+ [carbon]
+ pattern = ^carbon\.
+ retentions = 60:90d
+
+ [sfive]
+ pattern = ^sfive\.
+ retentions = 15s:10d,1m:21d,15m:5y
+
+ [default_1min_for_1day]
+ pattern = .*
+ retentions = 60s:1d
diff --git a/contrib/k8s-emc/graphite-statefulset.yml b/contrib/k8s-emc/graphite-statefulset.yml
new file mode 100644
index 0000000..99b1d95
--- /dev/null
+++ b/contrib/k8s-emc/graphite-statefulset.yml
@@ -0,0 +1,76 @@
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ namespace: emc
+ name: stats-graphite
+ labels:
+ app: graphite
+ tier: stats
+spec:
+ serviceName: stats-graphite
+ replicas: 1
+ selector:
+ matchLabels:
+ app: graphite
+ tier: stats
+ updateStrategy:
+ type: RollingUpdate
+ template:
+ metadata:
+ labels:
+ app: graphite
+ tier: stats
+ spec:
+ nodeName: emc-stats
+ securityContext:
+ runAsUser: 998
+ fsGroup: 998
+ initContainers:
+ - name: prepare-graphite-data
+ image: busybox
+ command: ['sh', '-c', 'chown 998:998 /srv/data && chmod 700 /srv/data']
+ securityContext:
+ runAsUser: 0
+ volumeMounts:
+ - name: graphite-data
+ mountPath: /srv/data
+ containers:
+ - name: carbon
+ image: spreadspace/graphite-carbon:master-4
+ imagePullPolicy: Always
+ volumeMounts:
+ - name: home
+ mountPath: /srv
+ - name: carbon-config
+ mountPath: /srv/config
+ - name: graphite-data
+ mountPath: /srv/data
+ - name: api
+ image: spreadspace/graphite-api:master-4
+ imagePullPolicy: Always
+ volumeMounts:
+ - name: home
+ mountPath: /srv
+ - name: api-config
+ mountPath: /srv/config
+ - name: api-index
+ mountPath: /srv/index
+ - name: graphite-data
+ mountPath: /srv/data
+ volumes:
+ - name: home
+ emptyDir:
+ medium: Memory
+ - name: graphite-data
+ hostPath:
+ type: DirectoryOrCreate
+ path: /srv/stats/graphite
+ - name: carbon-config
+ configMap:
+ name: stats-graphite-carbon
+ - name: api-config
+ configMap:
+ name: stats-graphite-api
+ - name: api-index
+ emptyDir:
+ medium: Memory
diff --git a/contrib/k8s-emc/graphite-svc.yml b/contrib/k8s-emc/graphite-svc.yml
new file mode 100644
index 0000000..2c9d9bf
--- /dev/null
+++ b/contrib/k8s-emc/graphite-svc.yml
@@ -0,0 +1,18 @@
+apiVersion: v1
+kind: Service
+metadata:
+ namespace: emc
+ name: stats-graphite
+ labels:
+ app: graphite
+ tier: stats
+spec:
+ selector:
+ app: graphite
+ tier: stats
+ clusterIP: 172.18.242.31
+ ports:
+ - name: line
+ port: 2003
+ - name: api
+ port: 8080