func (j *TestJig) checkNodePortServiceReachability(svc *v1.Service, pod *v1.Pod) error {
	clusterIP := svc.Spec.ClusterIP
	servicePorts := svc.Spec.Ports

	// Consider only 2 nodes for testing
	nodes, err := e2enode.GetBoundedReadySchedulableNodes(j.Client, 2)
	if err != nil {
		return err
	}

	err = j.waitForAvailableEndpoint(ServiceEndpointsTimeout)
	if err != nil {
		return err
	}

	for _, servicePort := range servicePorts {
		err = testReachabilityOverServiceName(svc.Name, servicePort, pod)
		if err != nil {
			return err
		}
		err = testReachabilityOverClusterIP(clusterIP, servicePort, pod)
		if err != nil {
			return err
		}
		err = testReachabilityOverNodePorts(nodes, servicePort, pod, clusterIP)
		if err != nil {
			return err
		}
	}

	return nil
}
// checkNodePortServiceReachability ensures that service of type nodePort are reachable
// - Internal clients should be reachable to service over -
//   	ServiceName:ServicePort, ClusterIP:ServicePort and NodeInternalIPs:NodePort
// - External clients should be reachable to service over -
//   	NodePublicIPs:NodePort
checkNodePortServiceReachability ensures that service of type nodePort are reachable
- Internal clients should be reachable to service over
ServiceName:ServicePort, ClusterIP:ServicePort and NodeInternalIPs:NodePort
- External clients should be reachable to service over
NodePublicIPs:NodePort
// checkNodePortServiceReachability ensures that service of type nodePort are reachable // - Internal clients should be reachable to service over - // ServiceName : ServicePort ClusterIP : ServicePort and NodeInternalIPs : NodePort // - External clients should be reachable to service over - // NodePublicIPs : NodePort
func (j *TestJig) checkNodePortServiceReachability(svc *v1.Service, pod *v1.Pod) error {
	clusterIP := svc.Spec.ClusterIP
	servicePorts := svc.Spec.Ports
	nodes, err := e2enode.GetBoundedReadySchedulableNodes(j.Client, 2)
	if err != nil {
		return err
	}
	err = j.waitForAvailableEndpoint(ServiceEndpointsTimeout)
	if err != nil {
		return err
	}
	for _, servicePort := range servicePorts {
		err = testReachabilityOverServiceName(svc.Name, servicePort, pod)
		if err != nil {
			return err
		}
		err = testReachabilityOverClusterIP(clusterIP, servicePort, pod)
		if err != nil {
			return err
		}
		err = testReachabilityOverNodePorts(nodes, servicePort, pod, clusterIP)
		if err != nil {
			return err
		}
	}
	return nil
}
func ( j * TestJig ) checkNodePortServiceReachability ( svc * v1 . Service , pod * v1 . Pod ) error { clusterIP := svc . Spec . ClusterIP servicePorts := svc . Spec . Ports nodes , err := e2enode . GetBoundedReadySchedulableNodes ( j . Client , 2 ) if err != nil { return err } err = j . waitForAvailableEndpoint ( ServiceEndpointsTimeout ) if err != nil { return err } for _ , servicePort := range servicePorts { err = testReachabilityOverServiceName ( svc . Name , servicePort , pod ) if err != nil { return err } err = testReachabilityOverClusterIP ( clusterIP , servicePort , pod ) if err != nil { return err } err = testReachabilityOverNodePorts ( nodes , servicePort , pod , clusterIP ) if err != nil { return err } } return nil }
checkNodePortServiceReachability ensures that service of type nodePort are reachable
 Internal clients should be reachable to service over
ServiceName:ServicePort, ClusterIP:ServicePort and NodeInternalIPs:NodePort
 External clients should be reachable to service over
NodePublicIPs:NodePort
checkNodePortServiceReachability ensures that service of type nodePort are reachable Internal clients should be reachable to service over ServiceName : ServicePort ClusterIP : ServicePort and NodeInternalIPs : NodePort External clients should be reachable to service over NodePublicIPs : NodePort
// Consider only 2 nodes for testing