code: func RequestsOnlyLocalTraffic(service *v1.Service) bool {
  	if service.Spec.Type != v1.ServiceTypeLoadBalancer &&
  		service.Spec.Type != v1.ServiceTypeNodePort {
  		return false
  	}
  	return service.Spec.ExternalTrafficPolicy == v1.ServiceExternalTrafficPolicyTypeLocal
  }
docs: // RequestsOnlyLocalTraffic checks if service requests OnlyLocal traffic.