Kubernetes allows a lot. After discovering its features, it’s easy to think it can magically transform your application deployment process into a painless no-event. For Hello World applications, that is the case. Unfortunately, not many of us do deploy such applications day-to-day.
You need to think about application backward compatibility, possible rollback, database schema migration, etc. I believe the later is one of the biggest pain point. In this talk, I’ll demo how to update a Spring Boot app deployed on a Kubernetes cluster with a non-trivial database schema migration with the help of Flyway, while keeping the service up during the entire update process.
2. @nicolas_frankel
• Developer, team lead, architect,
whatever it takes
• Recently Developer Advocate
• Interested in DevOps
• Curious about Kubernetes
• Loves Spring
Me, myself and I
3. @nicolas_frankel
Hazelcast
HAZELCAST IMDG is an operational,
in-memory, distributed computing
platform that manages data using
in-memory storage, and performs
parallel execution for breakthrough
application speed and scale.
HAZELCAST JET is the ultra fast,
application embeddable, 3rd
generation stream processing
engine for low latency batch
and stream processing.
4. @nicolas_frankel
1. Engineers want it
• It’s ”cool”
2. Users want it
• It’s expected
3. Business wants it
• It’s revenue
Why zero-downtime?
15. @nicolas_frankel
• Kubernetes need to know the
application’s state
• To mark the pod ready
• Spring Boot offers the actuator
• With the /health endpoint
Apps don’t start instantly
24. @nicolas_frankel
Steps decomposition
1. Create ADDRESS table
• App use the PERSON table data as previously
• Trigger copy data to ADDRESS table
2. The ADDRESS becomes the “source of truth”
• App now uses the ADDRESS table data
• Trigger copy data to the PERSON table
3. Stop copying the data
4. (Remove extra columns in the PERSON table)
27. @nicolas_frankel
• Based on migrations
• A migration is a SQL script
• Each migration is versioned
• Flyway records migrations in a
dedicated table
Flyway 101