spotahome / redis-operator

Redis Operator creates/configures/manages high availability redis with sentinel automatic failover atop Kubernetes.
Apache License 2.0
1.49k stars 356 forks source link

No way to make custom Pod Disruption Policy #628

Closed importnil closed 8 months ago

importnil commented 1 year ago

Expected behaviour

In a k8s cluster maintenance process, single instanced pods should be allowed to halt. Would be good to either set policy's MaxUnavailable to 1 if replicas number set in the RedisFailover configuration equals 1, or, to be even more flexible, be allowed to manage the policies in complete.

Actual behaviour

When num. of sentinels and/or Redis instances equals 1, Pod Disruption Policy that is being created by the operator, makes it impossible to put k8s cluster into maintenance, e.g. restart third-party cloud managed nodes, since the operator ensures, that the Policy has always MinAvailable property set to 1.

Steps to reproduce the behaviour

Use 1 replica for any of these: sentinel, redis.

Environment

Logs

Example line: error when evicting pods/"redis-sentinel-5fb9b7ffc-z4qxn" -n "production" (will retry after 5s): Cannot evict pod as it would violate the pod's disruption budget.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 45 days with no activity.

ebuildy commented 10 months ago

You can use disablePodDisruptionBudget configuration for both redis and sentinel, to disable PDB in case of there is a single replica.

paretl commented 10 months ago

@ebuildy I don't know if you already tested it, but disablePodDisruptionBudget doesn't work for me. Do you have any feebacks on it? The related issue that I've created: https://github.com/spotahome/redis-operator/issues/653

ebuildy commented 10 months ago

I have just tested, this is OK.

You must use the latest CRD, and operator v1.3.0

github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 45 days with no activity.

github-actions[bot] commented 8 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.