How to configure the logging app to use Custom PVC volume for Fluentd buffers
This document (000020976) is provided subject to the disclaimer at the end of this document.
Environment
Rancher with Rancher-Logging chart v2
Resolution
- Go to Apps > Charts, then Select Logging and click Install/Update
- Select the project to install the logging app and select "Customize Helm Options before install", and click Next
-
Select Edit YAML tab and modify the following:
-
Search for disablePvc and change that from true to false
disablePvc: false
- Search for the bufferStorageVolume section and change it to the following (Modify the STORAGE_CLASS_NAME with your environement value):
bufferStorageVolume:
pvc:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 40Gi
storageClassName: "<STORAGE_CLASS_NAME>"
volumeMode: Filesystem
- Modify other fields if required, and finally, Click on Next, then Install/Update.
If the logging app is already installed, then the PVC will need to be created manually and associated with the fluentd StatefulSet, as per the following steps:
- From UI go to Storage > PersistentVolumeClaims, and Create PVC to be used for the fluentd pod (PVC need to be on the namespace cattle-logging-system):
> kubectl get pvc -n cattle-logging-system
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
rancher-logging-root-fluentd-buffer Bound pvc-4b78c686-7b68-4f7d-a40f-32c0a5470831 40Gi RWO rancher-storage-class 10s
-
From UI, go to Workload > StatefulSets, then Edit the fluentd StatefulSet YAML ( rancher-logging-root-fluentd) and update the claimName for the rancher-logging-root-fluentd-buffer volume with the PVC name.
-
Change the following two lines:
- emptyDir: {}
name: rancher-logging-root-fluentd-buffer
- To the following:
- name: rancher-logging-root-fluentd-buffer
persistentVolumeClaim:
claimName: "rancher-logging-root-fluentd-buffer"
- Finally, click on save, and a new fluentd pod will be scheduled with to use PV for buffer volume.
To confirm if fluentd is using PV for buffer volume, you can run the following command and review the mount and volumes output sections:
kubectl describe pod rancher-logging-root-fluentd-0 -n cattle-logging-system
- If fluentd is using PV for buffer volume, the output will be:
rancher-logging-root-fluentd-buffer:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: rancher-logging-root-fluentd-buffer
ReadOnly: false
- If fluentd is using EmptyDir for buffer volume, the output will be:
rancher-logging-root-fluentd-buffer:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
Reference:
- https://banzaicloud.com/docs/one-eye/logging-operator/logging-infrastructure/fluentd/
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.