<p>We are deploying Java microservices to AWS 'ECR &gt; EKS' using helm3 and Jenkins CI/CD pipeline. However what we see is, if we re-run Jenkins job to re-install the deployment/pod, then the pod does not re-install if there are no code changes. It still keeps the old running pod as is. <strong>Use case considered here is,</strong> <em>AWS Secrets Manager configuration for db secret pulled during deployment has changed, so service needs to be redeployed by re-triggering the Jenkins job.</em></p>
<h2><strong>Approach 1</strong> :   <a href="https://helm.sh/docs/helm/helm_upgrade/" rel="nofollow noreferrer">https://helm.sh/docs/helm/helm_upgrade/</a></h2>
<p>I tried using 'helm upgrade --install --force ....' as suggested in helm3 upgrade documentation but it fails with below error in Jenkins log</p>
<blockquote>
<p>&quot;Error: UPGRADE FAILED: failed to replace object: Service &quot;dbservice&quot; is invalid: spec.clusterIP: Invalid value: &quot;&quot;: field is immutable&quot;</p>
</blockquote>
<h2><strong>Approach 2</strong> : using --recreate-pods from earlier helm version</h2>
<p>With 'helm upgrade --install --recreate-pods ....', I  am getting below warning in Jenkins log</p>
<blockquote>
<p>&quot;Flag --recreate-pods has been deprecated, functionality will no longer be updated. Consult the documentation for other methods to recreate pods&quot;</p>
</blockquote>
<p>However, the pod gets recreated. But as we know --recreate-pods is not soft-restart. Thus we would have downtime, which breaks the microservice principle.</p>
<h3>helm version used</h3>
<p><em>version.BuildInfo{Version:&quot;v3.4.0&quot;, GitCommit:&quot;7090a89efc8a18f3d8178bf47d2462450349a004&quot;, GitTreeState:&quot;clean&quot;, GoVersion:&quot;go1.14.10&quot;}</em></p>
<h3>question</h3>
<ul>
<li>How to use --force with helm 3 with helm upgrade for above error ?</li>
<li>How to achieve soft-restart with deprecated --recreate-pods ?</li>
</ul>

<p>This is nicely described in Helm documentation: <a href="https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments" rel="nofollow noreferrer">https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments</a></p>
