flagger icon indicating copy to clipboard operation
flagger copied to clipboard

Flagger StatefulSet support

Open eserden opened this issue 6 years ago • 11 comments

HI All
If there is any chance to get Statefulset supported by flagger canary?

eserden avatar Jan 15 '20 14:01 eserden

How would traffic splitting work for StatefulSets? Does it make sense to spin up lets say a Postgres cluster with empty databases and give it a 1% of the traffic? Wouldn't that break your apps?

stefanprodan avatar Jan 15 '20 14:01 stefanprodan

@stefanprodan I have a different case. I am using Statefulset for Kafka streams apps ( https://kafka.apache.org/documentation/streams/) it persists only local store which could be safely recreated. And I can use both versions at the same time

eserden avatar Jan 15 '20 15:01 eserden

My understand is that for streams apps the traffic is not HTTP based so for the traffic split to work would have to cover https://github.com/weaveworks/flagger/issues/375

stefanprodan avatar Jan 15 '20 15:01 stefanprodan

@stefanprodan while it's not a best practice, sometime we require to create HTTP web service, which has persistent cache (like spring boot + eh cache which is initialised from files during startup). This makes it impossible at all to use such types of applications by Flagger.

Rabajaba avatar Jan 15 '20 15:01 Rabajaba

@Rabajaba your use case makes sense to me, going to tag this as a feature request and include it in Flagger feature planing.

stefanprodan avatar Jan 15 '20 15:01 stefanprodan

@stefanprodan I think the most ideal use of flagger with statefulsets is with the rolling update partition parameter: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#rolling-out-a-canary

So flagger can change the partition, perform tests and check metrics, then change the partition again. Repeat until all pods are replaced.

Main difference from deployment canary is that the same statefulset and service is used for the whole process, and no % traffic weight can be used.

Let me know what you think.

Thanks

dudicoco avatar Jul 15 '20 10:07 dudicoco

Main difference from deployment canary is that the same statefulset and service is used for the whole process, and no % traffic weight can be used.

Is this acceptable? Looks like it would not work for Rabajaba's use-case.

stefanprodan avatar Jul 15 '20 10:07 stefanprodan

@stefanprodan I didn't totally understand his use case, but I believe it is a different use case.

A "true" stateful application cannot have two different statefulset resources unless they somehow form a cluster, I believe that the solution which I've suggested is the most appropriate for most statefulsets, as documented in the official kuberentes docs.

dudicoco avatar Jul 15 '20 11:07 dudicoco

On this issue. We also have both use cases, e.g. true stateful sets for which partition replacement will work. And also stateful set with only local caches. Solution proposed by @dudicoco will work in both cases.

yoks avatar Sep 08 '20 15:09 yoks

A "true" stateful application cannot have two different statefulset resources unless they somehow form a cluster, I believe that the solution which I've suggested is the most appropriate for most statefulsets, as documented in the official kuberentes docs.

I agree with this statement as well. There is no other way I've been able to wrap my head around doing blue/green on a stateful application.

Would love to see support for this land soon.

Sovietaced avatar Jun 17 '21 03:06 Sovietaced

Hi

any news about statefulset support ? no plan to reopen this issue #1391 ?

Thx

rgrente avatar Apr 17 '24 14:04 rgrente