Skip to content

Commit cc3c9c9

Browse files
Merge pull request #563 from steveb/kill-ramdisk-logs
Kill ramdisk-logs inotifywait as a pre-stop command
2 parents 4ebf7f0 + 5ae3782 commit cc3c9c9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

pkg/ironicconductor/statefulset.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,18 @@ func StatefulSet(
226226
SecurityContext: &corev1.SecurityContext{
227227
RunAsUser: &runAsUser,
228228
},
229+
// inotifywait doesn't terminate on SIGTERM so call SIGKILL as a
230+
// pre-stop command
231+
Lifecycle: &corev1.Lifecycle{
232+
PreStop: &corev1.LifecycleHandler{
233+
Exec: &corev1.ExecAction{
234+
Command: []string{
235+
"/usr/bin/pkill",
236+
"inotifywait",
237+
},
238+
},
239+
},
240+
},
229241
}
230242

231243
containers := []corev1.Container{

pkg/ironicinspector/statefulset.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,18 @@ func StatefulSet(
259259
SecurityContext: &corev1.SecurityContext{
260260
RunAsUser: &runAsUser,
261261
},
262+
// inotifywait doesn't terminate on SIGTERM so call SIGKILL as a
263+
// pre-stop command
264+
Lifecycle: &corev1.Lifecycle{
265+
PreStop: &corev1.LifecycleHandler{
266+
Exec: &corev1.ExecAction{
267+
Command: []string{
268+
"/usr/bin/pkill",
269+
"inotifywait",
270+
},
271+
},
272+
},
273+
},
262274
}
263275
containers = append(containers, ramdiskLogsContainer)
264276

0 commit comments

Comments
 (0)