-
Notifications
You must be signed in to change notification settings - Fork 526
[GEP-28] Implement Bastion
controller in provider-local
#12366
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
[GEP-28] Implement Bastion
controller in provider-local
#12366
Conversation
@timebertt: GitHub didn't allow me to request PR reviews from the following users: maboehm. Note that only gardener members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
c5ecd5c
to
937614b
Compare
After a few iterations with the e2e tests, I believe I tackled all scenarios 😄 |
/assign |
937614b
to
ae81b4e
Compare
ae81b4e
to
5bf1db4
Compare
Rebased to resolve conflicts |
/assign |
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.
Thanks for implementing the Bastion
for provider-local
to drive the GEP-28
story forward.
pkg/provider-local/controller/operatingsystemconfig/actuator.go
Outdated
Show resolved
Hide resolved
The `logrotate` binary is not installed in provider-local machine images. Hence, the `containerd-logrotate.service` is failing: ``` root@machine-shoot--local--local-local-57666-r5xnh:/# systemctl status containerd-logrotate.service × containerd-logrotate.service - Rotate and Compress System Logs Loaded: loaded (/etc/systemd/system/containerd-logrotate.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Sat 2025-06-14 22:10:04 UTC; 1min 22s ago Duration: 2ms TriggeredBy: ● containerd-logrotate.timer Process: 3692 ExecStart=/usr/sbin/logrotate -s /var/lib/containerd-logrotate.status /etc/systemd/containerd.conf (code=exited, status=203/EXEC) Main PID: 3692 (code=exited, status=203/EXEC) CPU: 465us Jun 14 22:10:04 machine-shoot--local--local-local-57666-r5xnh (ogrotate)[3692]: containerd-logrotate.service: Failed at step EXEC spawning /usr/sbin/logrotate: No such file or directory Jun 14 22:10:04 machine-shoot--local--local-local-57666-r5xnh systemd[1]: Started containerd-logrotate.service - Rotate and Compress System Logs. Jun 14 22:10:04 machine-shoot--local--local-local-57666-r5xnh systemd[1]: containerd-logrotate.service: Main process exited, code=exited, status=203/EXEC Jun 14 22:10:04 machine-shoot--local--local-local-57666-r5xnh systemd[1]: containerd-logrotate.service: Failed with result 'exit-code'. ``` Because of this, the system never reaches `multi-user.target`. Hence, `systemd-user-sessions.service` never runs and never removes `/run/nologin`. ``` root@machine-shoot--local--local-local-57666-r5xnh:/# cat /run/nologin "System is booting up. Unprivileged users are not permitted to log in yet. Please come back later. For technical details, see pam_nologin(8)." ``` This prevents non-privileged users (e.g., `gardener`) from logging into the machine, e.g., via SSH.
For some reason, `systemd-user-sessions.service` is not activated automatically in local machine pods. Without this, non-privileged users are not able to log into the machine (e.g., via SSH). As a workaround, add a drop-in to trigger it explicitly.
f44bab2
to
5f53b85
Compare
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.
Love the PR :)
...etup/extensions/provider-local/components/controllerregistration/controllerregistration.yaml
Show resolved
Hide resolved
/lgtm |
LGTM label has been added. Git tree hash: fbb999d050e2b6618180821635a3adc3a9b2b515
|
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ScheererJ 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 |
/retest |
How to categorize this PR?
/area dev-productivity testing
/kind enhancement
What this PR does / why we need it:
This PR implements the
Bastion
controller in provider-local. For this, it deploys another pod with the local node image and a correspondingLoadBalancer
service. As with otherLoadBalancer
services in the local setup, there is some network magic involved (see the provider-localservice
controller).This PR also fixes user login sessions on local shoot nodes (required for SSH).
Finally, the PR adds e2e tests for the newly added
Bastion
functionality. With this, we extend the test coverage of local e2e tests to previously untested parts of the codebase.The e2e tests use a newly introduced package (
pkg/utils/ssh
) that simplifies SSH connection handling for our use cases (e2e test and later on ingardenadm bootstrap
).This prepares the
Bastion
usage ingardenadm bootstrap
, see GEP-28.Which issue(s) this PR fixes:
Part of #2906
Special notes for your reviewer:
/cc @ScheererJ @rfranzke @maboehm
Release note: