-
Notifications
You must be signed in to change notification settings - Fork 413
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
Add kubens.service, drop-ins, and kubensenter prefix to kubelet.service #3274
Add kubens.service, drop-ins, and kubensenter prefix to kubelet.service #3274
Conversation
Skipping CI for Draft Pull Request. |
I expect these tests to fail until we get builds with the updated openshift-hyperkube RPM. |
/retest |
/unhold The latest RHCOS has the right version of openshift-hyperkube now: https://releases-rhcos-art.cloud.privileged.psi.redhat.com/?stream=releases/rhcos-4.12&release=412.86.202207292203-0#412.86.202207292203-0 |
/retest |
/retest-required |
1 similar comment
/retest-required |
e9cd9bf
to
f1d6fd0
Compare
This PR has changes more specific to kubelet and crio, so will be good to get reviewed by node team first to ensure that it doesn't break anything. Looking briefly at the changes, don't see any concern from MCO side. Will do another pass once LGTM'ed from node team side. /assign @rphillips @haircommander |
/retest |
it may benefit us to put some work into making sure https://bugzilla.redhat.com/show_bug.cgi?id=2057618 is not due to the mount namespace before going forward with this. it's been assigned to me but I've not been able to give it enough attention |
I can take a peek at it, to see if I can find it it's related to this feature. |
FYI: CRI-O 1.25 has now landed in RHCOS as of Build 412.86.202208032219-0 This means that it should now be possible to spin up a cluster with that RHCOS and this PR and do actual end-to-end testing with the resulting system by enabling the 'kubens.service' in systemd. |
/retest |
/approve @lack did some investigation trying to see if the bug I attached could be related. Because he did not find anything, and my hunch is only that, I am okay moving forward with this |
f1d6fd0
to
e4e3ca6
Compare
I have done some preliminary testing via ClusterBot, building this PR. I have verified:
|
/retest |
templates/worker/01-worker-kubelet/on-prem/units/kubelet.service.yaml
Outdated
Show resolved
Hide resolved
f09dbd7
to
cd543c8
Compare
Sounds likely! This is why telco likes it especially for SNO - systemd CPU usage goes way down! And why we want it for everyone; who doesn't want a couple more CPU cycles available for workloads? |
cd543c8
to
50f0bff
Compare
/hold until openshift/kubernetes#1350 goes in so we can remove the |
This imports the systemd components from the vendored github.com/containers/kubensmnt and keeps them in-sync via `make update` and `make verify` (thanks to the new `hack/update-templates.sh` script) Signed-off-by: Jim Ramsay <jramsay@redhat.com>
To be upgrade-compatible with RHEL workers (where the MC may take effect before the openshift-hyperkube RPM is upgraded, which is what installs the new 'kubensenter' script), as well as to be backwards compatible with older openshift-hyperkube RPMs or other potential edge cases, we wrap kubelet's execution in a temporary wrapper script which will execute kubebnsenter if it is available on the system as the service starts up. Signed-off-by: Jim Ramsay <jramsay@redhat.com>
50f0bff
to
d8f42ae
Compare
The CI checks are going to fail until openshift/kubernetes#1350 goes in and the change makes its way into an RHCOS nightly. Once that's done I'll remove the hold and retest, and we should be good to go! |
/unhold |
/retest |
@lack: The following test failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
@@ -0,0 +1,18 @@ | |||
# Autogenerated by hack/update-templates.sh; do not edit |
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.
does this being here mean we'll have the kubens enabled by default? is that intended?
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.
This drop-in does nothing except set the environment variable that will be laid down by kubens.service if it's running, so it's safe fro this to be present all the time.
The kubens.service itself is not being enabled by default (see https://github.com/openshift/machine-config-operator/pull/3274/files/d8f42ae7a8e66970a5fcbdaac6fd8712d1466ba7#diff-c38a0be931e5bc991f959879c6af89aee96be94967b4544f63ace1d52e5f88ccR3)
# Note: This compatibility wrapper is needed to bridge the gap from OCP 4.11->4.12 when the new 'kubensenter' script is being introduced. | ||
# It can be removed (and the kubelet.service should call kubensenter directly) when 4.11 is no longer a release we must upgrade from. | ||
mode: 0755 | ||
path: "/usr/local/bin/kubenswrapper" |
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.
why /usr/local instead of /usr?
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.
Ignition can't write to /usr
. See #3137
LGTM |
From my PoV |
@cgwalters it is tested in an e2e periodic openshift/release#31715 |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, haircommander, lack, rphillips 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 |
- What I did
In support of openshift enhancement https://github.com/openshift/enhancements/blob/master/enhancements/hide-container-mountpoints.md
This comes in 2 parts:
The new 'kubens.service' that drives this new feature is disabled by default, so should be safe to go in as soon as the openshift-hyperkube RPM lands which includes the new 'kubensenter' script required for the 1st part. (openshift/kubernetes#1327)
/hold until openshift-hyperkube arrives with the new kubensenter script.
- How to verify it
This cannot be mergedf until the new
kubensenter
script arrives via an updated openshift-hyperkube, but enabling of this feature also requires that a CRI-O change (cri-o/cri-o#5974) that will arrive once RHCOS includes CRI-O 1.25.Once both prerequisites are in place, this feature should be verified as follows:
Note all 3 are identical
kubens.service
systemd service. If this is done, both kubelet and CRI-O should be in a different namespace that systemd, but the system should otherwise behave normally:With the feature enabled:
Note that kubelet and crio are identical, but unique from pid 1
- Description for the changelog
Adds a new optional systemd service called
kubens.service
which can be enabled to segregate all Kubernetes-specific mount points into a new mount namespace separate from the host OS and systemd.