-
Notifications
You must be signed in to change notification settings - Fork 48
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
Do not run nova services as root #598
Do not run nova services as root #598
Conversation
/hold I need to test this |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/0a07729177b944599c3cca2a74e37ebd ✔️ nova-operator-content-provider SUCCESS in 1h 32m 07s |
db sync job fails but must gather does not collect the job's log :/ I need to try this with a local build |
@SeanMooney you mentioned that kolla set config needs sudo and that the sudo is managed by rootwrap in the k8s nova images.
It seems to me that the sudo config is incomplete as we have no filters defined. For dbsync we directly call If I understand correctly kolla_set_config needs sudo. How should we provide it in this env? |
Ahh there is an extra line the sudoers file:
that suggest that we only need a user in the kolla group for the kolla commands to work. And nova is in the kolla group:
|
739322f
to
c4dc4cc
Compare
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
c4dc4cc
to
e8666bd
Compare
So lets try to switch from root(0) to nova(42436) in the pods |
/test functional |
so this is a bug we should never call kolla_set_configs directly we have two options cellDBSyncCommand = "sudo /usr/local/bin/kolla_set_configs && /bin/sh -c /var/lib/openstack/bin/dbsync.sh" as you said or cellDBSyncCommand = "/usr/local/bin/kolla_start" and provide a kolla config.json file with that would be my preference. i.e. instead of bypassing the kolla image API we should correctly provide the kolla config.json to the job container and specify the command as normal in that. |
Thanks. I will rework this. FYI, we have an even worse situation in placement-operator openstack-k8s-operators/placement-operator#107 (comment) as I think the placement image itself is broken (placement user is no in the kolla group) |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/8ac4e9b28fff4df89503fdc8fb772371 ✔️ nova-operator-content-provider SUCCESS in 57m 20s |
e8666bd
to
14fb34d
Compare
This is now using sudo for kolla_set_config just to see if that make the rest of the pieces work. If so I can add another commit to use kolla config files to execute the job commands. |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/34595c044c1c4e929b1bead7576f47fb ❌ nova-operator-content-provider NODE_FAILURE Node request 200-0006654352 failed in 0s |
recheck |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/14de4d53311d4a6c90c60cea8e3a172e ❌ nova-operator-content-provider NODE_FAILURE Node request 200-0006654921 failed in 0s |
recheck zuul nodepool should be back in business |
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/bc20599914454911845ad66d2485539e ✔️ nova-operator-content-provider SUCCESS in 1h 25m 42s |
Still no success even with sudo. And must gather still not provide job logs (and the related pod is deleted) so I need to go back and deploy it locally to see the error. |
14fb34d
to
85b0310
Compare
85b0310
to
20d348e
Compare
/test functional |
/unhold |
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.
im +1.5 on this im just wondering if we really need to change the script mode or not
lgtm |
Now each podified service runs as nova user. This needed a bit of change how we run our jobs. Now the scripts of the job is moved by kolla and started via kolla_start. As apache is also running with the nova user we needed to set some permissions for the api containers. At the same time we make sure that apache logs everything to its stdout / stderr to make the logs visible. Implements: https://issues.redhat.com/browse/OSPRH-1374
20d348e
to
0347903
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gibizer, SeanMooney The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d644726
into
openstack-k8s-operators:main
Setting scc to nonroot-v2 (or nonroot) does not work with kolla + sudo. It seem sudo needs uid 0 to exists
|
To have a user with uid 0 mapped to some (nova) id user in the host, usernsmappings should work for cri-o in openshift the similar thay it works for podman, see cri-o/cri-o#5294 |
Tried the manual mapping in #605 it does not seem to work. |
there is still something to research in that regard, see #605 (comment) |
Implements: https://issues.redhat.com/browse/OSPRH-1374