Skip to content

Conversation

@devin-ai-integration
Copy link

Ticket Reference

Epic: EB-1 (Spring Boot Upgrade)
Ticket: EB-10
Risk Level: LOW

Summary

This PR updates the Kubernetes deployment configuration for Spring Boot 3.4.9 compatibility, addressing configuration management, graceful shutdown, health probes, and actuator endpoint configuration.

Changes Made

1. Spring Boot Version Upgrade

  • Upgraded from Spring Boot 3.3.3 to 3.4.9 in pom.xml
  • Added spring-boot-starter-actuator dependency for health probe support

2. Kubernetes Deployment Configuration (kubernetes/bankapp-deployment.yml)

  • Added: terminationGracePeriodSeconds: 30 for graceful shutdown support
  • Enabled: Health probes with proper endpoints:
    • Readiness probe: /actuator/health/readiness
    • Liveness probe: /actuator/health/liveness
  • Added: Timeout and failure threshold configuration for robust health checking
  • Verified: Resource limits (512Mi-1Gi memory, 250m-500m CPU) remain appropriate

3. Application Configuration (src/main/resources/application.properties)

  • Configured actuator endpoints (health, info only for security)
  • Enabled Kubernetes-specific health probe endpoints
  • Configured graceful shutdown with 30s timeout
  • Restricted health detail exposure to authorized users only

4. Helm Template Alignment (helm/bankapp/templates/deployment.yml)

  • Added terminationGracePeriodSeconds: 30
  • Updated health probe endpoints to match standalone deployment
  • Added timeout and failure threshold configuration

5. Comprehensive Documentation

  • Created EB-10-IMPLEMENTATION-NOTES.md with:
    • Research findings on Spring Boot 3.4.9 changes
    • Design decisions and justifications
    • Configuration consistency matrix
    • Testing recommendations
    • Security considerations

Key Spring Boot 3.4.9 Compatibility Features

Graceful Shutdown

  • Now enabled by default in Spring Boot 3.4+
  • Properly configured with 30-second timeout in both Kubernetes and application
  • Ensures in-flight requests complete before pod termination

Health Probe Endpoints

  • Using Spring Boot 3.4+ recommended endpoints: /actuator/health/readiness and /actuator/health/liveness
  • Properly configured with management.endpoint.health.probes.enabled=true

Actuator Security

  • Only health and info endpoints exposed
  • Health details restricted to authorized users
  • All other actuator endpoints remain internal

Configuration Management

The repository uses both standalone Kubernetes manifests and Helm charts. This PR maintains consistency between both approaches:

Configuration Standalone K8s Helm Template Status
terminationGracePeriodSeconds 30s 30s ✅ Aligned
Readiness endpoint /actuator/health/readiness /actuator/health/readiness ✅ Aligned
Liveness endpoint /actuator/health/liveness /actuator/health/liveness ✅ Aligned
Probe timeouts 3s 3s ✅ Aligned

Breaking Changes

None - All changes are backward compatible.

Testing Recommendations

1. Build and Local Testing

mvn clean package
mvn spring-boot:run
curl http://localhost:8080/actuator/health
curl http://localhost:8080/actuator/health/readiness
curl http://localhost:8080/actuator/health/liveness

2. Kubernetes Deployment Testing

kubectl apply -f kubernetes/bankapp-deployment.yml
kubectl get pods -n bankapp-namespace
kubectl describe pod <pod-name> -n bankapp-namespace

3. Graceful Shutdown Testing

kubectl delete pod <pod-name> -n bankapp-namespace
# Observe graceful shutdown in logs (30s completion window)

Success Criteria

  • Environment variables remain compatible with Spring Boot 3.4.9
  • Resource limits are appropriate
  • terminationGracePeriodSeconds accommodates graceful shutdown (30s+)
  • Health probe endpoints verified and aligned across deployment methods
  • No breaking changes in configuration
  • Configuration management approach is consistent and documented

Security Considerations

  • Actuator endpoints limited to health and info only
  • Health details require authorization to view
  • No sensitive endpoints exposed externally
  • Compatible with existing NetworkPolicy configurations

References

Deployment Impact

  • Zero downtime: Rolling update with health probe verification
  • Rollback ready: Simple rollback via kubectl rollout undo if needed
  • Next steps: Rebuild Docker image with updated dependencies

Link to Devin run: https://app.devin.ai/sessions/c02e23d52ef24d829b9312be7e125640

Requested by: Alex Peng (alex.peng@windsurf.com) / @alexjpeng

- Upgraded Spring Boot from 3.3.3 to 3.4.9 in pom.xml
- Added spring-boot-starter-actuator dependency for health probe support
- Configured terminationGracePeriodSeconds: 30 for graceful shutdown
- Enabled health probes with /actuator/health/readiness and /liveness endpoints
- Added actuator configuration in application.properties
- Aligned Helm template deployment with standalone K8s deployment
- Created comprehensive implementation documentation (EB-10-IMPLEMENTATION-NOTES.md)

Changes ensure compatibility with Spring Boot 3.4.9 features:
- Graceful shutdown (enabled by default in 3.4+)
- Kubernetes health probe endpoints
- Proper termination grace period
- Secure actuator endpoint exposure

All changes are backward compatible with zero breaking changes.
Resource limits verified as appropriate for Spring Boot 3.4.9.

Ticket: EB-10
Epic: EB-1 (Spring Boot Upgrade)
Risk: LOW
Co-Authored-By: Alex Peng <alexander.j.peng@gmail.com>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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

Successfully merging this pull request may close these issues.

1 participant