rbdmirror: rotate logs for rbd mirroring
The rbd mirror daemon logs to two files, one for the
lodal mirror daemon and one log from the other cluster
where the mirroring is taking place. The log rotation
was only rotating one of the logs. Now we make the
log rotation more general to catch all of the rbd mirror
logs from different clusters.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 055c22f4c4)
This commit is contained in:
1 parent
154e19f0d7
commit
c2fc2425e7
2 files changed
+8
-5
No files matched your search
@@ -17,8 +17,6 @@ limitations under the License.
|
||||
package rbd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
"github.com/rook/rook/pkg/operator/ceph/config"
|
||||
"github.com/rook/rook/pkg/operator/ceph/controller"
|
||||
@@ -52,7 +50,12 @@ func (r *ReconcileCephRBDMirror) makeDeployment(daemonConfig *daemonConfig, rbdM
|
||||
if r.cephClusterSpec.LogCollector.Enabled {
|
||||
shareProcessNamespace := true
|
||||
podSpec.Spec.ShareProcessNamespace = &shareProcessNamespace
|
||||
podSpec.Spec.Containers = append(podSpec.Spec.Containers, *controller.LogCollectorContainer(fmt.Sprintf("ceph-client.rbd-mirror.%s", daemonConfig.DaemonID), r.clusterInfo.Namespace, *r.cephClusterSpec))
|
||||
|
||||
// The rbd mirror daemon logs to multiple logs, so we need a more generous log rotation filter for files:
|
||||
// ceph-client.rbd-mirror.a.log
|
||||
// <CLUSTER_FSID>-client.rbd-mirror-peer.log
|
||||
logRotationFilter := "*-client.rbd-mirror*"
|
||||
podSpec.Spec.Containers = append(podSpec.Spec.Containers, *controller.LogCollectorContainer(logRotationFilter, r.clusterInfo.Namespace, *r.cephClusterSpec))
|
||||
}
|
||||
|
||||
// Replace default unreachable node toleration
|
||||
|
||||
Reference in new issue
Block a user