// newService creates a new Service for a Apimanager resource.
// It expose the service with Nodeport type with minikube ip as the externel ip.
newService creates a new Service for a Apimanager resource.
It expose the service with Nodeport type with minikube ip as the externel ip.
// newService creates a new Service for a Apimanager resource . // It expose the service with Nodeport type with minikube ip as the externel ip .
func apim1Service(apimanager *apimv1alpha1.Apimanager) *corev1.Service {
	labels := map[string]string{
		"deployment": "wso2am-pattern-1-am",
		"node": "wso2am-pattern-1-am-1",
	}
	return &corev1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Name:      "apim-1-svc",
			Namespace: apimanager.Namespace,
			OwnerReferences: []metav1.OwnerReference{
				*metav1.NewControllerRef(apimanager, apimv1alpha1.SchemeGroupVersion.WithKind("Apimanager")),
			},
		},
		Spec: corev1.ServiceSpec{
			Selector: labels,
			Type:     "NodePort",
			ExternalIPs: []string{"192.168.99.101"},
			Ports: []corev1.ServicePort{
				{
					Name:       "binary",
					Protocol:   corev1.ProtocolTCP,
					Port:       9611,
					TargetPort: intstr.IntOrString{Type: intstr.Int, IntVal: 9611},
					NodePort:   32002,
				},
				{
					Name:       "binary-secure",
					Protocol:   corev1.ProtocolTCP,
					Port:       9711,
					TargetPort: intstr.IntOrString{Type: intstr.Int, IntVal: 9711},
					NodePort:   32003,
				},
				{
					Name:       "jms-tcp",
					Protocol:   corev1.ProtocolTCP,
					Port:       5672,
					TargetPort: intstr.IntOrString{Type: intstr.Int, IntVal: 5672},
					NodePort:   32004,
				},
				{
					Name:       "servlet-https",
					Protocol:   corev1.ProtocolTCP,
					Port:       9443,
					TargetPort: intstr.IntOrString{Type: intstr.Int, IntVal: 9443},
					NodePort:   32001,
				},
			},
		},
	}
}
func apim1Service ( apimanager * apimv1alpha1 . Apimanager ) * corev1 . Service { labels := map [ string ] string { " " : " " , " " : " " , } return & corev1 . Service { ObjectMeta : metav1 . ObjectMeta { Name : " " , Namespace : apimanager . Namespace , OwnerReferences : [ ] metav1 . OwnerReference { * metav1 . NewControllerRef ( apimanager , apimv1alpha1 . SchemeGroupVersion . WithKind ( " " ) ) , } , } , Spec : corev1 . ServiceSpec { Selector : labels , Type : " " , ExternalIPs : [ ] string { " " } , Ports : [ ] corev1 . ServicePort { { Name : " " , Protocol : corev1 . ProtocolTCP , Port : 9611 , TargetPort : intstr . IntOrString { Type : intstr . Int , IntVal : 9611 } , NodePort : 32002 , } , { Name : " " , Protocol : corev1 . ProtocolTCP , Port : 9711 , TargetPort : intstr . IntOrString { Type : intstr . Int , IntVal : 9711 } , NodePort : 32003 , } , { Name : " " , Protocol : corev1 . ProtocolTCP , Port : 5672 , TargetPort : intstr . IntOrString { Type : intstr . Int , IntVal : 5672 } , NodePort : 32004 , } , { Name : " " , Protocol : corev1 . ProtocolTCP , Port : 9443 , TargetPort : intstr . IntOrString { Type : intstr . Int , IntVal : 9443 } , NodePort : 32001 , } , } , } , } }
newService creates a new Service for a Apimanager resource.
newService creates a new Service for a Apimanager resource .
// Name: apimanager.Spec.ServiceName,