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

osd: cleanup cluster using the root UID #9380

Merged
merged 1 commit into from Dec 10, 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
10 changes: 9 additions & 1 deletion pkg/operator/ceph/cluster/cleanup.go
Expand Up @@ -123,10 +123,18 @@ func (c *ClusterController) cleanUpJobContainer(cluster *cephv1.CephCluster, mon
}...)
}

// Run a UID 0 since ceph-volume does not support running non-root
// See https://tracker.ceph.com/issues/53511
// Also, it's hard to catch the ceph version since the cluster is being deleted so not
// implementing a version check and simply always run this as root
rootUserID := int64(0)
securityContext := osd.PrivilegedContext()
securityContext.RunAsUser = &rootUserID

return v1.Container{
Name: "host-cleanup",
Image: c.rookImage,
SecurityContext: osd.PrivilegedContext(),
SecurityContext: securityContext,
VolumeMounts: volumeMounts,
Env: envVars,
Args: []string{"ceph", "clean"},
Expand Down