<p>I have a PostgreSQL Kubernetes Service based on <a href="https://github.com/zalando/patroni" rel="nofollow noreferrer">Patroni</a>/<a href="https://github.com/zalando/spilo" rel="nofollow noreferrer">Spilo</a>.
This Kubernetes service deploys a cluster of three PostgreSQL pods + three Etcd pods.
During maintenance, I had a failure and I wasn't able to restore the old configuration that worked fine before the rolling update.</p>
<p>I searched for documentation and it seems StatefulSets doesn't support rollbacks as deployment. I found <a href="https://stackoverflow.com/questions/62425011/statefulset-unable-to-rollback-if-the-pods-are-not-in-running-state">this thread</a> that <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#forced-rollback" rel="nofollow noreferrer">references this doc</a>.</p>
<p>To be honest, however, I didn't understand how to proceed.</p>
<p>My cluster has the following pods:</p>
<pre><code>postgres-0
postgres-1
postgres-2
etcd-0
etcd-1
etcd-2
</code></pre>
<p>my rolling update simply needed to upgrade the etcd image from 3.3.20 to 3.5.1. The upgrade started to update etcd-2 and the pod crashed for several reasons. So my intention was to stop the update and revert the etcd-2 to 3.3.20.</p>
<p>How I should proceed in a situation like this? How liveness and probing can help me here?
At the moment, the solution proposed in that thread is a bit confusing to me.</p>

Salvatore D'angelo
<p>To undo changes that have been made, first checkout the rollout history <code>kubectl rollout history sts &lt;name&gt; -n &lt;namespace if not default&gt;</code>.</p>
<p>Get more details about a revision <code>kubectl rollout history sts &lt;name&gt; --revision &lt;number&gt; -n &lt;namespace if not default&gt;</code>.</p>
<p>Undo the changes <code>kubectl rollout undo sts &lt;name&gt; --to-revision &lt;number&gt; -n &lt;namespace if not default&gt;</code></p>
