-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logrotate: add design and api for logrotate
design and api for the csi pods logrotate Signed-off-by: parth-gr <[email protected]>
- Loading branch information
Showing
4 changed files
with
124 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Ceph CSI Log Rotate Design Document | ||
|
||
Log Rotate is the ability to rotate the logs by controlling the size of log files. | ||
With csi it will be includes to all the csi pods which includes csi daemons and provisoners. | ||
Using logrotate will create a log file at the hostpath and enable the logrotator sidecar container. | ||
Logrotator sidecar container will make sure that log files are rotated as per the inputs. | ||
|
||
Logroate configuration, | ||
|
||
`CephCSIOperatorConfig CRD`: | ||
|
||
```yaml | ||
kind: CephCSIOperatorConfig | ||
apiVersion: csi.ceph.io/v1alpha1 | ||
…. | ||
spec: | ||
logLevel: 1 | ||
driverSpecDefaults: | ||
log: | ||
logLevel: 5 | ||
logRotator: | ||
# one of: hourly, daily, weekly | ||
Periodicity: daily | ||
# SUFFIX may be 'M' or 'G' | ||
MaxLogSize: 500M | ||
MaxFiles: 5 | ||
logHostPath: /var/lib/log | ||
``` | ||
Similar settings will be overrided by `CephCSIDriver CRD`: | ||
|
||
```yaml | ||
kind: CephCSIDriver | ||
apiVersion: csi.ceph.io/v1alpha1 | ||
metadata: | ||
name: "<prefix>.<driver_type>.csi.ceph.com" | ||
namespace: <operator-namespace> | ||
spec: | ||
logLevel: 1 | ||
driverSpecDefaults: | ||
log: | ||
logLevel: 5 | ||
logRotator: | ||
# one of: hourly, daily, weekly | ||
Periodicity: daily | ||
# SUFFIX may be 'M' or 'G' | ||
MaxLogSize: 500M | ||
MaxFiles: 5 | ||
logHostPath: /var/lib/rook | ||
``` | ||
|
||
Logrotator sidecar container cpu and memory usage can configured by, | ||
|
||
`CephCSIOperatorConfig CRD`: | ||
```yaml | ||
spec: | ||
provisioner: | ||
logRotator: | ||
cpu: "500m" | ||
memory: "512Mi" | ||
plugin: | ||
logRotator: | ||
cpu: "500m" | ||
memory: "512Mi" | ||
``` | ||
|
||
For systems where SELinux is enabled (e.g. OpenShift),start plugin-controller as privileged that mount a host path. | ||
`CephCSIOperatorConfig CRD`: | ||
```yaml | ||
spec: | ||
provisioner: | ||
privileged: true | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters