Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph: add signal handling for log collector #8806

Merged
merged 1 commit into from Sep 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions pkg/operator/ceph/controller/spec.go
Expand Up @@ -66,8 +66,6 @@ var logger = capnslog.NewPackageLogger("github.com/rook/rook", "ceph-spec")

var (
cronLogRotate = `
set -xe

CEPH_CLIENT_ID=%s
PERIODICITY=%s
LOG_ROTATE_CEPH_FILE=/etc/logrotate.d/ceph
Expand Down Expand Up @@ -624,13 +622,18 @@ func LogCollectorContainer(daemonID, ns string, c cephv1.ClusterSpec) *v1.Contai
Name: logCollector,
Command: []string{
"/bin/bash",
"-c",
"-x", // Print commands and their arguments as they are executed
"-e", // Exit immediately if a command exits with a non-zero status.
"-m", // Terminal job control, allows job to be terminated by SIGTERM
"-c", // Command to run
fmt.Sprintf(cronLogRotate, daemonID, c.LogCollector.Periodicity),
},
Image: c.CephVersion.Image,
VolumeMounts: DaemonVolumeMounts(config.NewDatalessDaemonDataPathMap(ns, c.DataDirHostPath), ""),
SecurityContext: PodSecurityContext(),
Resources: cephv1.GetLogCollectorResources(c.Resources),
// We need a TTY for the bash job control (enabled by -m)
TTY: true,
}
}

Expand Down