Skip to content

NodePort service type configuration

A NodePort service is a type of Kubernetes service that exposes an application on a specific port across all nodes in the cluster.^[dashboatd.install.md]

Configuration

To configure a service as a NodePort, you must modify the service type field.^[dashboatd.install.md]

This is typically done by editing the service definition, for example, using kubectl edit svc <service-name> -n <namespace>, and changing the Type to NodePort.^[dashboatd.install.md]

Verification

Once applied, the configuration creates a mapping between a static port on the node (the NodePort) and the target port of the Pod.^[dashboatd.install.md]

You can verify the configuration and retrieve the open port by listing all services.^[dashboatd.install.md] The output will display the service type as NodePort and show the mapping in the format <target-port>:<node-port>/TCP.^[dashboatd.install.md]

Access

After the service is configured and the port is exposed, the application can be accessed externally via the network using <NodeIP>:<NodePort>.^[dashboatd.install.md]

Sources

  • dashboatd.install.md
  • [[ClusterIP]]
  • [[LoadBalancer]]