<p>Let's say I have two versions of chart <em>Foo</em> - v1 and v2. I had installed v1 (as revision 1) then upgraded to v2 (revision 2).</p>

<p>Now I'd like to rollback to first revision (<code>helm rollback Foo 1</code>). Is there any way to run job <strong>defined in v2</strong> at some point of rollback <strong>after</strong> v1 resources are restored. </p>

<p>It must perform some actions on v1 resources because backwards incompatible changes made in v2.</p>

<p>I'd assume that pre-rollback hook defined in v2 should do the job. Unfortunetly chart lifecycle documentation is a bit confusing for me.</p>

<hr>

<p>I tried to use </p>

<pre class="lang-yaml prettyprint-override"><code>  annotations:
    "helm.sh/hook": post-rollback
</code></pre>

<p>as suggested in the answers. Unfortunately when I do rollback from v2 to v1 then v1's version of pre/post rollback job is executed. I need to execute job defined in v2 chart.</p>

<p>The following documentation and examples should clear up your confusion - </p>

<p><a href="https://helm.sh/docs/topics/charts_hooks/#the-available-hooks" rel="nofollow noreferrer">https://helm.sh/docs/topics/charts_hooks/#the-available-hooks</a></p>

<p><a href="https://helm.sh/docs/topics/charts_hooks/#writing-a-hook" rel="nofollow noreferrer">https://helm.sh/docs/topics/charts_hooks/#writing-a-hook</a></p>

<p>tldr</p>

<p>Add the following to the job you want to execute.</p>

<pre><code>annotations:
  "helm.sh/hook": post-rollback
</code></pre>
