Expose the service on each node's IP.
Section: Services
NodePort Service YAML
yaml
yaml
apiVersion: v1
kind: Service
metadata:
name: api-nodeport
spec:
selector:
app: api
ports:
- port: 80
targetPort: 8080
nodePort: 30080
type: NodePortLearn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Services
LoadBalancer Service YAML
Request external load balancing from the platform.
Headless Service YAML
Expose individual Pod DNS records for stateful apps.