From cc02399c4cbcaf086eddf4025f1646711fc49600 Mon Sep 17 00:00:00 2001 From: gauravsitlani Date: Tue, 18 Oct 2022 16:28:26 +0530 Subject: [PATCH] core: enabling logCollector by default for coredump enabling logCollector by default will enable the coredump generation in case a process terminates with a segmentation fault. Signed-off-by: gauravsitlani --- Documentation/CRDs/Cluster/ceph-cluster-crd.md | 4 ++-- deploy/charts/rook-ceph-cluster/values.yaml | 7 ++++--- deploy/examples/cluster-on-pvc.yaml | 4 ++++ deploy/examples/cluster.yaml | 8 ++++---- tests/framework/installer/ceph_manifests.go | 4 ++++ 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Documentation/CRDs/Cluster/ceph-cluster-crd.md b/Documentation/CRDs/Cluster/ceph-cluster-crd.md index de87a7fa0..9fd776756 100755 --- a/Documentation/CRDs/Cluster/ceph-cluster-crd.md +++ b/Documentation/CRDs/Cluster/ceph-cluster-crd.md @@ -65,8 +65,8 @@ For more details on the mons and when to choose a number other than `3`, see the * `disable`: is set to `true`, the crash collector will not run on any node where a Ceph daemon runs * `daysToRetain`: specifies the number of days to keep crash entries in the Ceph cluster. By default the entries are kept indefinitely. * `logCollector`: The settings for log collector daemon. - * `enabled`: if set to `true`, the log collector will run as a side-car next to each Ceph daemon. The Ceph configuration option `log_to_file` will be turned on, meaning Ceph daemons will log on files in addition to still logging to container's stdout. These logs will be rotated. (default: false) - * `periodicity`: how often to rotate daemon's log. (default: 24h). Specified with a time suffix which may be 'h' for hours or 'd' for days. **Rotating too often will slightly impact the daemon's performance since the signal briefly interrupts the program.** + * `enabled`: if set to `true`, the log collector will run as a side-car next to each Ceph daemon. The Ceph configuration option `log_to_file` will be turned on, meaning Ceph daemons will log on files in addition to still logging to container's stdout. These logs will be rotated. In case a daemon terminates with a segfault, the coredump files will be commonly be generated in `/var/lib/systemd/coredump` directory on the host, depending on the underlying OS location. (default: `true`) + * `periodicity`: how often to rotate daemon's log. (default: 24h). Specified with a time suffix which may be `h` for hours or `d` for days. **Rotating too often will slightly impact the daemon's performance since the signal briefly interrupts the program.** * `annotations`: [annotations configuration settings](#annotations-and-labels) * `labels`: [labels configuration settings](#annotations-and-labels) * `placement`: [placement configuration settings](#placement-configuration-settings) diff --git a/deploy/charts/rook-ceph-cluster/values.yaml b/deploy/charts/rook-ceph-cluster/values.yaml index fc8f8ce76..01559add4 100644 --- a/deploy/charts/rook-ceph-cluster/values.yaml +++ b/deploy/charts/rook-ceph-cluster/values.yaml @@ -156,9 +156,10 @@ cephClusterSpec: # daysToRetain: 30 # enable log collector, daemons will log on files and rotate - # logCollector: - # enabled: true - # periodicity: daily # one of: hourly, daily, weekly, monthly + logCollector: + enabled: true + periodicity: daily # one of: hourly, daily, weekly, monthly + maxLogSize: 500M # SUFFIX may be 'M' or 'G'. Must be at least 1M. # automate [data cleanup process](https://github.com/rook/rook/blob/master/Documentation/ceph-teardown.md#delete-the-data-on-hosts) in cluster destruction. cleanupPolicy: diff --git a/deploy/examples/cluster-on-pvc.yaml b/deploy/examples/cluster-on-pvc.yaml index ee4976be2..f8b195b40 100644 --- a/deploy/examples/cluster-on-pvc.yaml +++ b/deploy/examples/cluster-on-pvc.yaml @@ -47,6 +47,10 @@ spec: ssl: true crashCollector: disable: false + logCollector: + enabled: true + periodicity: daily # one of: hourly, daily, weekly, monthly + maxLogSize: 500M # SUFFIX may be 'M' or 'G'. Must be at least 1M. storage: storageClassDeviceSets: - name: set1 diff --git a/deploy/examples/cluster.yaml b/deploy/examples/cluster.yaml index 57c2e88a2..78e842c7a 100644 --- a/deploy/examples/cluster.yaml +++ b/deploy/examples/cluster.yaml @@ -113,10 +113,10 @@ spec: # specified number of days. #daysToRetain: 30 # enable log collector, daemons will log on files and rotate - # logCollector: - # enabled: true - # periodicity: daily # one of: hourly, daily, weekly, monthly - # maxLogSize: 500M # SUFFIX may be 'M' or 'G'. Must be at least 1M. + logCollector: + enabled: true + periodicity: daily # one of: hourly, daily, weekly, monthly + maxLogSize: 500M # SUFFIX may be 'M' or 'G'. Must be at least 1M. # automate [data cleanup process](https://github.com/rook/rook/blob/master/Documentation/Storage-Configuration/ceph-teardown.md#delete-the-data-on-hosts) in cluster destruction. cleanupPolicy: # Since cluster cleanup is destructive to data, confirmation is required. diff --git a/tests/framework/installer/ceph_manifests.go b/tests/framework/installer/ceph_manifests.go index 2022e87b4..1daac0b6a 100644 --- a/tests/framework/installer/ceph_manifests.go +++ b/tests/framework/installer/ceph_manifests.go @@ -165,6 +165,10 @@ spec: crashCollector: disable: false ` + pruner + ` + logCollector: + enabled: true + periodicity: daily + maxLogSize: 500M disruptionManagement: managePodBudgets: true osdMaintenanceTimeout: 30