code: func createPortAndServiceSpec(servicePort int, targetServicePort int, nodePort int, servicePortName string, extraServicePorts []corev1.ServicePort) ([]corev1.ServicePort, corev1.ServiceType) {
  	//Use the Cluster IP type for the service port if NodePort isn't provided.
  	//Otherwise, we will be binding the master service to a NodePort.
  	servicePorts := []corev1.ServicePort{{Protocol: corev1.ProtocolTCP,
  		Port:       int32(servicePort),
  		Name:       servicePortName,
  		TargetPort: intstr.FromInt(targetServicePort)}}
  	serviceType := corev1.ServiceTypeClusterIP
  	if nodePort > 0 {
  		servicePorts[0].NodePort = int32(nodePort)
  		serviceType = corev1.ServiceTypeNodePort
  	}
  	if extraServicePorts != nil {
  		servicePorts = append(servicePorts, extraServicePorts...)
  	}
  	return servicePorts, serviceType
  }
docs: // createPortAndServiceSpec creates an array of service ports.
  // If the NodePort value is 0, just the servicePort is used, otherwise, a node port is exposed.