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

BUG 2228764: nfs: run dbus-daemon sidecar as dbus user instead of root #506

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/operator/ceph/nfs/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ func (r *ReconcileCephNFS) daemonContainer(nfs *cephv1.CephNFS, cfg daemonConfig
func (r *ReconcileCephNFS) dbusContainer(nfs *cephv1.CephNFS) v1.Container {
_, dbusMount := dbusVolumeAndMount()

// uid of the "dbus" user in most (all?) Linux distributions
dbusUID := int64(81)

return v1.Container{
Name: "dbus-daemon",
Command: []string{
Expand All @@ -270,6 +273,9 @@ func (r *ReconcileCephNFS) dbusContainer(nfs *cephv1.CephNFS) v1.Container {
},
Env: k8sutil.ClusterDaemonEnvVars(r.cephClusterSpec.CephVersion.Image), // do not need access to Ceph env vars b/c not a Ceph daemon
Resources: nfs.Spec.Server.Resources,
SecurityContext: &v1.SecurityContext{
RunAsUser: &dbusUID,
},
}
}

Expand Down
Loading