I got a question to expose a deployment via nodeport with tcp port of 8888. But, when I mention
nodePort: 8888 in the yaml file. It says, it is not a standard range port. How could we resolve this?
NodePort range between 30000 - 32767.
So, should I mention one of them of my own choice if they didn’t mention the port in the question
@Pradeep you will never specify a specific nodeport when creating. So you will always allow it to take and yes later you can edit via kube edit and update if question says a specific port.
got you. I am assuming we need to mention it always when creating service with nodeport.
No, that’s not necessary. Please give it a try in the lab.
Note - If you will not specify, then by default it will choose between 30000-32767.
Sure, thank you
What is the imperative command to create a nodeport service? I believe by default it chooses clusterip
k expose deploy deployment-name --name=service-name --port=8888 --type=NodePort