Is there way to specify a custom NodePort port in a kubernetes service YAML definition? I need to be able to define the port explicitly in my configuration file.
相关问题
- Microk8s, MetalLB, ingress-nginx - How to route ex
- How do I change the storage class of existing pers
- Docker task in Azure devops won't accept "$(pw
- Use awslogs with kubernetes 'natively'
- IPAddress.[Try]Parse parses 192.168 to 192.0.0.168
You can set the type
NodePort
in yourService
Deployment. Note that there is aNode Port Range
configured for your API server with the option--service-node-port-range
(by default30000-32767
). You can also specify a port in that range specifically by setting thenodePort
attribute under thePort
object, or the system will chose a port in that range for you.So a
Service
example with specifiedNodePort
would look like this:For more information on NodePort, see this doc. For configuring API Server Node Port range please see this.