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

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

Open
mosinnik opened this issue Jun 28, 2024 · 1 comment
Open

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

mosinnik opened this issue Jun 28, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@mosinnik
Copy link

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 longhorn/longhorn#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 mosinnik added the bug Something isn't working label Jun 28, 2024
@mosinnik mosinnik changed the title non root user can't use mounted block device in kube non root user can't use mounted longhorn block device in kube Jul 3, 2024
@kobzonega kobzonega added enhancement New feature or request and removed bug Something isn't working labels Aug 11, 2024
@kobzonega
Copy link
Contributor

kobzonega commented Aug 11, 2024

@mosinnik

It related to longhorn/longhorn#8088 with workarounds.

I think it's Loghorn bug with mount as root with super privileges instead of use disk group. As what I see that bug was already fixed by this PR longhorn/longhorn-engine#1043. Please try to update this component

So we need to able to setup securityContext for pods in operator manifest or remove runAsNonRoot: true

In most cases it's securityContext configuration allows you to run the YDB cluster correctly with respecting the security restrictions. Probably it'll be good enhancement if we found enough cases where it will be useful. In this case it's not bug of ydb-operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants