private boolean updateService(Service service) {
        final List<ServicePort> ports = service.getSpec().getPorts();
        final Integer nodePort0 =
                ports.stream()
                     .filter(p -> portName == null || portName.equals(p.getName()))
                     .map(ServicePort::getNodePort)
                     .filter(Objects::nonNull)
                     .findFirst().orElse(null);
        if (nodePort0 == null) {
            if (portName != null) {
                logger.warn("No node port matching '{}' in the service: {}", portName,
                            service);
            } else {
                logger.warn(
                        "No node port in the service. Either 'NodePort' or 'LoadBalancer' " +
                        "should be set as the type for your Kubernetes service to expose " +
                        "a node port. type:{}, service:{}", service.getSpec().getType(),
                        service);
            }
            return false;
        }
        this.service = service;
        nodePort = nodePort0;
        return true;
    }
Watches the service. {@link Watcher} will retry automatically on failures by {@link KubernetesClient}.
kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/endpoints/KubernetesEndpointGroup.java