fabric8
fabric8 copied to clipboard
mvn fabric8:apply / mvn fabric8:recreate never seems to delete any pods now
seems to be regression since the new kubernetes client.
Only tested on kubernetes so far. Normally when you run 'mvn fabric8:apply' or 'mvn fabric8:recreate' then after an RC is recreated/updated all the pods are deleted
I wonder if its due to changes in helper methods; like finding all the pods for an RC so they can be deleted?
We should add in functionality to scale rc to 0 before deleting rc. Optional I guess but default to scale down to mimic upstream delete IIRC.
I guess we'd also need to wait for the scale to zero to take effect before recreating/updating the RC too. But yeah - nice idea!
BTW we have the same issue with updating an RC too btw. Typically if you update an RC (e.g. to use a different set of env vars or docker image) we need to scale down the RC before applying the update
We need to ensure compatibility with kubernetes client to get consistent experience but can add as option. Important to think of zero downtime, meaning no scale down, update, scale up - need to think of rolling updates.
Yes, using a rolling update is another option we should support; though we probably want a separate maven goal for that as we'd not be recreating / updating a single RC but probably having a new RC for the new version etc
Following the convention in kubectl, update
the client should default to deleting cascaded resources (e.g. pods when updating an RC). update
is now deprecated btw & called replace
- follow fabric8io/kubernetes-client#44 for that change.
So it should be fine to do a client.replace(...)
& related resources should be deleted & replaced too.
Rolling update will come along soon too.