diff --git a/deploy/helm/sumologic/templates/deployment.yaml b/deploy/helm/sumologic/templates/deployment.yaml index 54b4150b1c..4f903c946e 100644 --- a/deploy/helm/sumologic/templates/deployment.yaml +++ b/deploy/helm/sumologic/templates/deployment.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: name: {{ template "sumologic.fullname" . }} labels: @@ -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: @@ -152,4 +156,15 @@ spec: - name: EXCLUDE_HOST_REGEX value: {{ .Values.sumologic.excludeHostRegex | quote }} - name: EXCLUDE_POD_REGEX - value: {{ .Values.sumologic.excludePodRegex | quote }} \ No newline at end of file + 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 }} diff --git a/deploy/helm/sumologic/templates/events-deployment.yaml b/deploy/helm/sumologic/templates/events-deployment.yaml index a415b458e4..901aa91ffc 100644 --- a/deploy/helm/sumologic/templates/events-deployment.yaml +++ b/deploy/helm/sumologic/templates/events-deployment.yaml @@ -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: @@ -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 @@ -73,4 +77,15 @@ spec: value: {{ .Values.sumologic.chunkLimitSize | quote }} - name: TOTAL_LIMIT_SIZE value: {{ .Values.sumologic.totalLimitSize | quote }} -{{- end }} \ No newline at end of file +{{- 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 }} diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index d5e4348f26..1f297d98a6 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -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: + ## 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