Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can change clusterip to nodeport command line without editor?

Tags:

kubernetes

NodePort This way of accessing Dashboard is only recommended for development environments in a single node setup.

Edit kubernetes-dashboard service.

$ kubectl -n kube-system edit service kubernetes-dashboard You should see yaml representation of the service. Change type: ClusterIP to type: NodePort and save file.

Can change clusterip to nodeport command line without editor? Thanks!

like image 569
Anton Patsev Avatar asked Jun 30 '18 08:06

Anton Patsev


People also ask

How do I change from ClusterIP to NodePort?

NodePort This way of accessing Dashboard is only recommended for development environments in a single node setup. Edit kubernetes-dashboard service. $ kubectl -n kube-system edit service kubernetes-dashboard You should see yaml representation of the service. Change type: ClusterIP to type: NodePort and save file.

How do I change Nodeports in Kubernetes?

If you set the type field to NodePort, the Kubernetes master will allocate a port from a range specified by --service-node-port-range flag (default: 30000-32767), and each Node will proxy that port (the same port number on every Node) into your Service. That port will be reported in your Service's . spec.

What is the difference between NodePort and ClusterIP?

ClusterIP : Exposes the Service on a cluster-internal IP. Choosing this value makes the Service only reachable from within the cluster. This is the default ServiceType . NodePort : Exposes the Service on each Node's IP at a static port (the NodePort ).


1 Answers

you can change it like this

kubectl patch svc kubernetes-dashboard --type='json' -p '[{"op":"replace","path":"/spec/type","value":"NodePort"}]'
like image 172
sfgroups Avatar answered Sep 18 '22 02:09

sfgroups