Warm tip: This article is reproduced from stackoverflow.com, please click
google-cloud-platform kubernetes openshift kubernetes-helm

Changing serviceType in Kuberntes using helm upgrade

发布于 2020-04-03 23:37:12

We have a service already deployed as a headless service i.e clusterIp : None in production. Now we need to change this to a non headless service i.e type should be ClusterIp and clusterIp should be set to some value other than None. I modified the charts and tried to deploy using helm upgrade command. But its not allowed and helm is complaining that service type is an immutable field.

kubectl edit svc also was not able to helpful. kubectl patch also dint work. Any workarounds for this problem other than deleting helm chart and redeploying it again?

Questioner
Sumit Nekar
Viewed
130
Nick 2020-02-03 23:33

If we are speaking about Services, then ClusterIP is usually assigned by the master and is the IP address of the service.

If specified, it will be allocated to the service if it is unused or else creation of the service will fail.

Valid values are None, empty string (""), or a valid IP address. None can be specified for a headless service when proxying is not required.

Cannot be updated.

You can find Kubernetes Top Level API Objects Documentation helpful.

Hope that sheds the light on the root cause of the issue you are facing (changing service type).