code: func ValidateServiceExternalTrafficFieldsCombination(service *core.Service) field.ErrorList {
  	allErrs := field.ErrorList{}
  
  	if service.Spec.Type != core.ServiceTypeLoadBalancer &&
  		service.Spec.Type != core.ServiceTypeNodePort &&
  		service.Spec.ExternalTrafficPolicy != "" {
  		allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "externalTrafficPolicy"), service.Spec.ExternalTrafficPolicy,
  			"ExternalTrafficPolicy can only be set on NodePort and LoadBalancer service"))
  	}
  
  	if !apiservice.NeedsHealthCheck(service) &&
  		service.Spec.HealthCheckNodePort != 0 {
  		allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "healthCheckNodePort"), service.Spec.HealthCheckNodePort,
  			"HealthCheckNodePort can only be set on LoadBalancer service with ExternalTrafficPolicy=Local"))
  	}
  
  	return allErrs
  }
docs: // ValidateServiceExternalTrafficFieldsCombination validates if ExternalTrafficPolicy,
  // HealthCheckNodePort and Type combination are legal. For update, it should be called
  // after clearing externalTraffic related fields for the ease of transitioning between
  // different service types.