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

Inconsistency in "Kubernetes Container Lifecycle" documentation after Spring Boot 3.4.0 upgrade #43830

Open
andrej-urvantsev opened this issue Jan 15, 2025 · 6 comments
Labels
for: team-meeting An issue we'd like to discuss as a team to make progress status: waiting-for-triage An issue we've not yet triaged

Comments

@andrej-urvantsev
Copy link

Or, maybe, not exactly inconsistency but now it's a bit misleading...

In the Kubernetes Container Lifecycle there is a suggestion to use preStop handler like this: command: ["sh", "-c", "sleep 10"]

Problem is that by default Spring Boot paketo images from now on use paketobuildpacks/builder-jammy-java-tiny image, which does not have any shell.

So, either a new recipe should be suggested or a word of warning should say that for default spring boot images that won't work anymore.

As a suggestion - maybe include "sleep" command into the image, so something like this would work?

lifecycle:
  preStop:
    exec:
      command:
        - sleep
        - 60
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 15, 2025
@philwebb
Copy link
Member

We also have #20995 open

@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Jan 15, 2025
@andrej-urvantsev
Copy link
Author

Then this ticket can be considered mostly as a documentation update and maybe worth to review #20995 in the light that situation has changed now - by default(using paketo buildpacks) there is no option to execute shell commands in container anymore.

@andrej-urvantsev
Copy link
Author

@philwebb maybe #20995 is not needed anymore - #20995 (comment)

Since 1.32 is GA and sleep option is enabled there, then right thing to do would be just to update the documentation.

@mhalbritter
Copy link
Contributor

The sleep option in the Kubernetes preStop hook is behind a feature gate: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-implementations

Sleep - Pauses the container for a specified duration. This is a beta-level feature default enabled by the PodLifecycleSleepAction feature gate.

@andrej-urvantsev
Copy link
Author

@mhalbritter from the release notes 1.32: PodLifecycleSleepAction is graduated to GA

Unfortunately, don't have 1.32 yet to verify, but looks like it's GA now.

@mhalbritter
Copy link
Contributor

Huh, yeah, looks like it. Then the doc is outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: team-meeting An issue we'd like to discuss as a team to make progress status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants