Skip to content

Commit

Permalink
Add support for data persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
maimaisie committed Jan 7, 2020
1 parent f7cfe4c commit eef281c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
19 changes: 17 additions & 2 deletions deploy/helm/sumologic/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: {{ template "sumologic.fullname" . }}
labels:
Expand Down Expand Up @@ -64,6 +64,10 @@ spec:
mountPath: /fluentd/etc/
- name: pos-files
mountPath: /mnt/pos/
{{- if and .Values.persistence.enabled (eq .Values.sumologic.fluentd.buffer "file") }}
- name: buffer
mountPath: "/fluentd/buffer"
{{- end}}
env:
- name: SUMO_ENDPOINT_METRICS
valueFrom:
Expand Down Expand Up @@ -152,4 +156,15 @@ spec:
- name: EXCLUDE_HOST_REGEX
value: {{ .Values.sumologic.excludeHostRegex | quote }}
- name: EXCLUDE_POD_REGEX
value: {{ .Values.sumologic.excludePodRegex | quote }}
value: {{ .Values.sumologic.excludePodRegex | quote }}
{{- if and .Values.persistence.enabled (eq .Values.sumologic.fluentd.buffer "file") }}
volumeClaimTemplates:
- metadata:
name: buffer
spec:
accessModes: [{{ .Values.persistence.accessMode }}]
storageClassName: {{ .Values.persistence.storageClass }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- end }}
19 changes: 17 additions & 2 deletions deploy/helm/sumologic/templates/events-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if eq .Values.sumologic.eventCollectionEnabled true }}
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: {{ printf "%s-events" (include "sumologic.fullname" .) }}
labels:
Expand Down Expand Up @@ -44,6 +44,10 @@ spec:
mountPath: /fluentd/etc/
- name: pos-files
mountPath: /mnt/pos/
{{- if and .Values.persistence.enabled (eq .Values.sumologic.fluentd.buffer "file") }}
- name: buffer
mountPath: "/fluentd/buffer"
{{- end}}
livenessProbe:
httpGet:
path: /fluentd.pod.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D
Expand Down Expand Up @@ -73,4 +77,15 @@ spec:
value: {{ .Values.sumologic.chunkLimitSize | quote }}
- name: TOTAL_LIMIT_SIZE
value: {{ .Values.sumologic.totalLimitSize | quote }}
{{- end }}
{{- if and .Values.persistence.enabled (eq .Values.sumologic.fluentd.buffer "file") }}
volumeClaimTemplates:
- metadata:
name: buffer
spec:
accessModes: [{{ .Values.persistence.accessMode }}]
storageClassName: {{ .Values.persistence.storageClass }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ eventsDeployment:
memory: 256Mi
cpu: "100m"

## Persist data to a persistent volume; Must be used together with Fluentd file buffer (fluentd.buffer="file")
persistence:
enabled: false

## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, Azure & OpenStack)
##
# storageClass: "-"
# annotations: {}
accessMode: ReadWriteOnce
size: 10Gi

sumologic:
## Setup

Expand Down

0 comments on commit eef281c

Please sign in to comment.