Skip to content

Commit dd139f8

Browse files
committed
config: add rke2 config to improve the device permission
- we need to set `device_ownership_from_security_context` to true Signed-off-by: Vicente Cheng <vicente.cheng@suse.com>
1 parent f12f664 commit dd139f8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

pkg/config/cos.go

+15
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,21 @@ func initRancherdStage(config *HarvesterConfig, stage *yipSchema.Stage) error {
363363
)
364364
}
365365

366+
// RKE2 settings of device permissions (device_ownership_from_security_context)
367+
rke2DeviceOwnershipConfig, err := render("rke2-91-harvester-cdi.yaml", config)
368+
if err != nil {
369+
return err
370+
}
371+
stage.Files = append(stage.Files,
372+
yipSchema.File{
373+
Path: "/etc/rancher/rke2/config.yaml.d/91-harvester-cdi.yaml",
374+
Content: rke2DeviceOwnershipConfig,
375+
Permissions: 0600,
376+
Owner: 0,
377+
Group: 0,
378+
},
379+
)
380+
366381
// RKE2 settings of kube-audit
367382
rke2KubeAuditConfig, err := render("rke2-92-harvester-kube-audit-policy.yaml", config)
368383
if err != nil {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# handle the permission issue of Longhorn for CDI
2+
"nonroot-devices": true

0 commit comments

Comments
 (0)