-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Support running docker container with gid != 0 #22081
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #22081 +/- ##
============================================
+ Coverage 73.57% 73.65% +0.07%
- Complexity 32553 32583 +30
============================================
Files 1874 1874
Lines 139252 139252
Branches 15260 15260
============================================
+ Hits 102451 102560 +109
+ Misses 28877 28782 -95
+ Partials 7924 7910 -14
Flags with carried forward coverage won't be shown. Click here to find out more. |
Good way to reproduce the issue with the current container (before applying this fix):
|
I created a separate issue about the issue with |
(cherry picked from commit 4097ddd)
(cherry picked from commit 4097ddd)
(cherry picked from commit 4097ddd)
(cherry picked from commit 4097ddd)
(cherry picked from commit 4097ddd)
Motivation
Currently Pulsar's docker image must be run with gid=0. There are environments where the group id 0 is prohibited by default. One example is Tanzu Kubernetes Grid <=1.24 where a default Pod Security Policy called
vmware-system-restricted
is used. That PSP contains this type of rule:In this case, it's not possible to use Pulsar's docker image since Pulsar needs write access to a few directories.
Modifications
change the owner of the writable directories to user id 10000.
This will allow Tanzu to work with this type of securityContext for each Pulsar component (Broker, Zookeeper, Bookkeeper)
Workaround
Before this fix is included, it's possible to create an overlay image where the ownership is modified for the required directories
Dockerfile
sample of building and pushing a patched image:
Documentation
doc
doc-required
doc-not-needed
doc-complete