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

Remove prestop configuration from deployment.yaml #8

Closed
scottfrederick opened this issue Jul 23, 2024 · 3 comments
Closed

Remove prestop configuration from deployment.yaml #8

scottfrederick opened this issue Jul 23, 2024 · 3 comments
Assignees

Comments

@scottfrederick
Copy link

The following should be removed from the example deployment.yaml file:

          lifecycle:
            preStop:
              exec:
                command: ["sh", "-c", "sleep 10"]

The preStop is not necessary since Spring Boot apps handle SIGTERM notifications and gracefully shut down.

In addition, Docker images for applications are often built with distroless base images that do not include a shell, so commands like the sh -c sleep 10 recommended here will not work. The ./mvnw spring-boot:build-image command suggested in this guide will use a base image that does not include a shell starting with Spring Boot 3.4.

@robertmcnees robertmcnees self-assigned this Jul 24, 2024
@robertmcnees
Copy link

Thanks, @scottfrederick. Great catch. I have a pending PR #7 on this guide that touches a lot of files. I made an additional commit there that removes the preStop instructions.

PR #7 is waiting on a review from @ryanjbaxter but please feel free to also have a look.

@scottfrederick
Copy link
Author

The credit goes to @anthonydahanne for finding this and bringing it to our attention. Thanks @robertmcnees for the cleanup PR, I'll take a look.

@robertmcnees
Copy link

This can likely be closed now that PR #7 is merged. Specifically this commit that was merged as part of that PR should solve the concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants