Is this a request for help?: No.
What keywords did you search in Kubernetes issues before filing this one?: 'kubectl edit', 'nodeport', 'change service type'
Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT
Kubernetes version (use kubectl version
): On HEAD (commit 81d01a8).
$ ./kubectl version
Client Version: version.Info{Major:"1", Minor:"7+", GitVersion:"v1.7.0-alpha.0.517+81d01a84e0f59f-dirty", GitCommit:"81d01a84e0f59fcedd69759f40d1669f5a9d7fda", GitTreeState:"dirty", BuildDate:"2017-02-28T21:01:01Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7+", GitVersion:"v1.7.0-alpha.0.517+81d01a84e0f59f-dirty", GitCommit:"81d01a84e0f59fcedd69759f40d1669f5a9d7fda", GitTreeState:"dirty", BuildDate:"2017-02-28T20:58:18Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Environment: Don't think this matter.
What happened:
I tried to use kubectl edit svc
to change a NodePort service to a ClusterIP service in the same way I used before, but failed.
What you expected to happen:
Being able to use kubectl edit svc
to change a NodePort service to a ClusterIP service.
How to reproduce it:
Create a service using below YAML file:
apiVersion: v1
kind: Service
metadata:
name: my-nginx
labels:
run: my-nginx
spec:
selector:
run: my-nginx
ports:
- port: 80
protocol: TCP
nodePort: 31786
type: NodePort
After the service is created, enter kubectl edit svc my-nginx
, change type
to ClusterIP and remove the nodePort
field. Will hit below error:
# services "my-nginx" was not valid:
# * spec.ports[0].name: Required value
# * spec.ports[1].name: Required value
# * spec.ports[1].protocol: Required value
# * spec.ports[1].targetPort: Invalid value: 0: must be between 1 and 65535, inclusive
# * spec.ports[0].nodePort: Invalid value: 31786: may not be used when `type` is 'ClusterIP'
Anything else we need to know:
Could not reproduce it with k8s v1.5.2.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4