Skip to content

Commit

Permalink
Merge pull request #8844 from rook/mergify/bp/release-1.7/pr-8806
Browse files Browse the repository at this point in the history
ceph: add signal handling for log collector (backport #8806)
  • Loading branch information
travisn committed Sep 27, 2021
2 parents ff09f80 + 205a8d8 commit 55afee2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/operator/ceph/controller/spec.go
Expand Up @@ -67,8 +67,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 @@ -625,13 +623,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

0 comments on commit 55afee2

Please sign in to comment.