// apim instance 2 Deployment creates a new Deployment for a Apimanager instance 2 resource.
apim instance 2 Deployment creates a new Deployment for a Apimanager instance 2 resource.
// apim instance 2 Deployment creates a new Deployment for a Apimanager instance 2 resource .
func apim2Deployment(apimanager *apimv1alpha1.Apimanager) *appsv1.Deployment {
	labels := map[string]string{
		"deployment": "wso2am-pattern-1-am",
		"node": "wso2am-pattern-1-am-2",
	}
	return &appsv1.Deployment{
		ObjectMeta: metav1.ObjectMeta{
			Name:      "apim-2-deploy",
			Namespace: apimanager.Namespace,
			OwnerReferences: []metav1.OwnerReference{
				*metav1.NewControllerRef(apimanager, apimv1alpha1.SchemeGroupVersion.WithKind("Apimanager")),
			},
		},
		Spec: appsv1.DeploymentSpec{
			Replicas: apimanager.Spec.Replicas,
			Selector: &metav1.LabelSelector{
				MatchLabels: labels,
			},
			Template: corev1.PodTemplateSpec{
				ObjectMeta: metav1.ObjectMeta{
					Labels: labels,
				},
				Spec: corev1.PodSpec{
					Containers: []corev1.Container{
						{
							Name:  "wso2am2",
							Image: "wso2/wso2am:3.0.0",
							VolumeMounts: []corev1.VolumeMount{
								{
									Name: "wso2am-pattern-1-am-volume-claim-synapse-configs",
									MountPath: "/home/wso2carbon/wso2-artifact-volume/repository/deployment/server/synapse-configs",
								},
								{
									Name: "wso2am-pattern-1-am-volume-claim-executionplans",
									MountPath:"/home/wso2carbon/wso2-artifact-volume/repository/deployment/server/executionplans",
								},
							},
							Ports: []corev1.ContainerPort{
								{
									ContainerPort: 8280,
									Protocol:      "TCP",
								},
								{
									ContainerPort: 8243,
									Protocol:      "TCP",
								},
								{
									ContainerPort: 9443,
									Protocol:      "TCP",
								},
								{
									ContainerPort: 9763,
									Protocol:      "TCP",
								},
							},
						},
					},
					Volumes: []corev1.Volume{
						{
							Name: "wso2am-pattern-1-am-volume-claim-synapse-configs",
							VolumeSource: corev1.VolumeSource{
								PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
									ClaimName:"pvc-synapse-configs",
								},
							},
						},
						{
							Name: "wso2am-pattern-1-am-volume-claim-executionplans",
							VolumeSource: corev1.VolumeSource{
								PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
									ClaimName: "pvc-execution-plans",
								},
							},
						},
					},
				},
			},
		},
	}
}
func apim2Deployment ( apimanager * apimv1alpha1 . Apimanager ) * appsv1 . Deployment { labels := map [ string ] string { " " : " " , " " : " " , } return & appsv1 . Deployment { ObjectMeta : metav1 . ObjectMeta { Name : " " , Namespace : apimanager . Namespace , OwnerReferences : [ ] metav1 . OwnerReference { * metav1 . NewControllerRef ( apimanager , apimv1alpha1 . SchemeGroupVersion . WithKind ( " " ) ) , } , } , Spec : appsv1 . DeploymentSpec { Replicas : apimanager . Spec . Replicas , Selector : & metav1 . LabelSelector { MatchLabels : labels , } , Template : corev1 . PodTemplateSpec { ObjectMeta : metav1 . ObjectMeta { Labels : labels , } , Spec : corev1 . PodSpec { Containers : [ ] corev1 . Container { { Name : " " , Image : " " , VolumeMounts : [ ] corev1 . VolumeMount { { Name : " " , MountPath : " " , } , { Name : " " , MountPath : " " , } , } , Ports : [ ] corev1 . ContainerPort { { ContainerPort : 8280 , Protocol : " " , } , { ContainerPort : 8243 , Protocol : " " , } , { ContainerPort : 9443 , Protocol : " " , } , { ContainerPort : 9763 , Protocol : " " , } , } , } , } , Volumes : [ ] corev1 . Volume { { Name : " " , VolumeSource : corev1 . VolumeSource { PersistentVolumeClaim : & corev1 . PersistentVolumeClaimVolumeSource { ClaimName : " " , } , } , } , { Name : " " , VolumeSource : corev1 . VolumeSource { PersistentVolumeClaim : & corev1 . PersistentVolumeClaimVolumeSource { ClaimName : " " , } , } , } , } , } , } , } , } }
apim instance 2 Deployment creates a new Deployment for a Apimanager instance 2 resource.
apim instance 2 Deployment creates a new Deployment for a Apimanager instance 2 resource .