4. Spring Boot 2.2
• Based on Spring Framework 5.2
• Spring Boot 1.x is end-of-life as of August 1st
• Java 13 Support added
• RSocket support
• 20~40% latency improvement over Sprinng Boot 2.1
5. Spring Boot 2.2 and Container
• Cloud Platform Kubernetes detection
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.stereotype.Service;
@Service
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES)
public class K8sService {
}
8. “Writing a quality Dockerfile is
still my users’ biggest point of friction”
David Dollar, CEO, Convox (a k8s/Docker PaaS)
9. Best practices for building containers
• Package a single app per container
• Properly handle PID 1, signal handling, and zombie processes
• Optimize for the Docker build cache
• Remove unnecessary tools
• Build the smallest image possible
• Use vulnerability scanning in Container Registry
• Properly tag your images
• Carefully consider whether to use a public image
From: https://cloud.google.com/solutions/best-practices-for-building-containers
10. Best practices for building containers
• Package a single app per container
• Properly handle PID 1, signal handling, and zombie processes
• Optimize for the Docker build cache
• Remove unnecessary tools
• Build the smallest image possible
• Use vulnerability scanning in Container Registry
• Properly tag your images
• Carefully consider whether to use a public image
From: https://cloud.google.com/solutions/best-practices-for-building-containers
32. testcontainer
• Java library that supports JUnit tests, providing lightweight, throwaway instances of
common databases, Selenium web browsers, or anything else that can run in a
Docker container.
• Data access layer integration tests
• Application integration tests
• UI/Acceptance tests
34. Why Spring Cloud Kubernetes?
Write Portable apps using Spring Cloud
• Same source code for different environments
• Spring Cloud provides right platform abstraction on no
matter which environments you use
• Seamless integration between Kubernetes and Spring
• Spring Cloud Kubernetes is GA since Feb 2019
35. Spring Cloud nicely fits with Kubernetes
Native Service Discovery
● Leverage Spring Cloud
Netflix without using
Eureka discovery server
● DiscoveryClient uses
Kubernetes DNS resolver
and cluster events
● Use @LoadBalanced and
LoadBalancerClient for
client-side load balancing
● Spring Cloud
Circuitbreaker
support(Hystrix and
Resilience4j)
Pod Health Indicator
● Pod health indicator
contributes to Health
actuator(/actuator/health)
Kubernetes Aware
● When app is running in
Kubernetes, profile
kubernetes is
automatically enabled
ConfigMap/Secret Support
● Hot reload configuration
● Inject External
configuration properties
using ConfigMap
● Map Spring config support
with ConfigMap: @Value,
@ConfigurationProperties
● Load Secret values into
beans