Symptoms
Tried to update inhouse-products to version 1.4.186 but the update failed with the following error:
[root@osscore ~]# helm upgrade inhouse-products a8n/inhouse-products --version 1.4.186 Error: UPGRADE FAILED: Service "camunda-rest" is invalid: spec.ports[0].nodePort: Forbidden: may not be used when `type` is 'ClusterIP'
Cause
The failure is caused by the following product issue PDI-1421, which cannot be fixed in the code.
Note: The failure happens only in environments with old versions of K8s/helm.
Resolution
Upgrade helm/K8s.
Example configuration where the issue does not occur:
[root@mn7 ~]# kubectl version Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.0", GitCommit:"cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState:"clean", BuildDate:"2021-04-08T16:31:21Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.5", GitCommit:"aea7bbadd2fc0cd689de94a54e5b7b758869d691", GitTreeState:"clean", BuildDate:"2021-09-15T21:04:16Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"} [root@mn7 ~]# helm version version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"}
Alternatively you may apply the below workaround.
Workaround
1. Backup the objects before deleting them:
kubectl get svc camunda-rest -o yaml > camunda-rest.yaml kubectl get cm inhouse-products-logging-config -o yaml > inhouse-products-logging-config.yaml
2. Delete the objects causing the conflict:
kubectl delete svc camunda-rest kubectl delete cm inhouse-products-logging-config
3. Re-try inhouse-products upgrade. It should complete successfully.