<p>I'm trying to edit services created via helm chart and when changing from NodePort to ClusterIP I get this error</p>
<pre class="lang-sh prettyprint-override"><code>The Service &quot;&lt;name&gt;&quot; is invalid: spec.ports[0].nodePort: Fordbidden: may not be used when 'type' is 'ClusterIP'
</code></pre>
<p>I've seen solutions from other people where they just run <code>kubectl apply -f service.yaml --force</code> - but I'm not using kubectl but helm to do it - any thoughts ? If it was just one service I would just update/re-deploy manually but there are xx of them.</p>

potatopotato
<p>Found the answer to my exact question in here <a href="https://www.ibm.com/support/knowledgecenter/SSSHTQ/omnibus/helms/all_helms/wip/reference/hlm_upgrading_service_type_change.html" rel="nofollow noreferrer">https://www.ibm.com/support/knowledgecenter/SSSHTQ/omnibus/helms/all_helms/wip/reference/hlm_upgrading_service_type_change.html</a></p>
<p>In short they suggest either to:</p>
<hr />
<p>There are three methods you can use to avoid the service conversion issue above. You will only need to perform one of these methods:</p>
<ul>
<li>Method 1: Installing the new version of the helm chart with a different release name and update all clients to point to the new probe service endpoint if required. Then delete the old release. This is the recommended method but requires a re-configuration on the client side.</li>
<li>Method 2: Manually changing the service type using kubectl edit svc. This method requires more manual steps but preserves the current service name and previous revisions of the helm chart. After performing this workaround, users should be able to perform a helm upgrade.</li>
<li>Method 3: Deleting and purging the existing helm release, and then install the new version of helm chart with the same release name.</li>
</ul>
