-
Notifications
You must be signed in to change notification settings - Fork 40.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing ClusterIP service with NodePort service fails #24040
Comments
How did you change it? sounds like you tried to apply an update with clusterIP=="" whereas the Service in the apiserver already had a clusterIP. Fyi the easiest way to update a Service is simply to run kubectl edit svcName, and change the one field (in this case Type from ClusterIP to NodePort). |
I just did a
afterwards:
|
A simple replace will try to update (get and re-put) which will try to preserve the clusterIP. A |
I can try later but I don´t understand why switching to NodePort leads to an error - I haven´t deleted the ip or similar. |
Without debugging too deep I believe it's because You can confirm by running One might argue that this behavior is unexpected, or that we should allow the same value to pass through etc, @kubernetes/kubectl |
Maybe you could implement "destroy-handlers" for some keys. e.g. handler that runs when ClusterIP is changed to some other property and sets |
|
…dBalancer `Service is invalid: spec.clusterIP: Invalid value: "None": may not be set to 'None' for LoadBalancer services` Relates to kubernetes/kubernetes#33766 kubernetes/kubernetes#24040 kubernetes/kubernetes#33036 Signed-off-by: grebois <[email protected]>
commenting out the "nodePort:" worked for me |
It had a service with type
ClusterIP
and wanted to switch it to typeNodePort
and it failed with the following message:`The Service "xyz" is invalid.
spec.clusterIP: Invalid value: "": field is immutable``
I deleted the existing service and created the new one which worked fine.
The text was updated successfully, but these errors were encountered: