ydb-kubernetes-operator icon indicating copy to clipboard operation
ydb-kubernetes-operator copied to clipboard

non root user can't use mounted longhorn block device in kube

Open mosinnik opened this issue 8 months ago • 1 comments

Default storage cfg.

On storage pod on stating got:

:BS_PDISK CRIT: PDiskId# 1 BlockDevice initialization error! Can't open file "/dev/kikimr_ssd_00": not enough rights. Marker# BPD39
:BS_PDISK CRIT: PDiskId# 1 bootstrapped to the StateError, reason# Can't open file "/dev/kikimr_ssd_00": not enough rights. Can not be initialized Config: {TPDiskConfg Path# "/dev/kikimr_ssd_00" Expected.......

Inside pod ydb run as ydb user but device mapped mounted for root without additional rights for ydb user:

ydb@storage-sample-7:/$ ls -l /dev/kikimr_ssd_00 
brw-rw----. 1 root root 8, 128 Jun 28 14:22 /dev/kikimr_ssd_00

It related to https://github.com/longhorn/longhorn/issues/8088 with workarounds. So we need to able to setup securityContext for pods in operator manifest or remove runAsNonRoot: true

operator 0.5.16 kube: 1.27.4

mosinnik avatar Jun 28 '24 15:06 mosinnik