Deploy Citrix solution for service of type LoadBalancer in AWS
A service of type LoadBalancer is a simpler and faster way to expose a microservice running in a Kubernetes cluster to the external world. In cloud deployments, when you create a service of type LoadBalancer, a cloud managed load balancer is assigned to the service. The service is, then, exposed using the load balancer. For more information about services of type LoadBalancer, see Services of type LoadBalancer.
With the Citrix solution for service of type LoadBalancer, you can use NetScaler to directly load balance and expose a service instead of the cloud managed load balancer. NetScaler provides this solution for service of type LoadBalancer for on-prem and cloud. Services of type LoadBalancer are natively supported in Kubernetes deployments on public clouds such as AWS, GCP, and Azure.
When you deploy a service in AWS, a load balancer is created automatically and the IP address is allocated to the external field of the service. In this Citrix solution, allocates the IP address and that IP address is the VIP of NetScaler VPX. NetScaler Ingress Controller, deployed in a Kubernetes cluster, configures a NetScaler deployed outside the cluster to load balance the incoming traffic. So, the service is accessed through NetScaler VPX instead of the cloud load balancer.
You need to specify the service type
as LoadBalancer
in the service definition. Setting the type
field to LoadBalancer
provisions a load balancer for your service on AWS.
is used to automatically allocate IP addresses to services of type LoadBalancer from a specified range of IP addresses. For more information about the Citrix solution for services of type LoadBalancer, see Expose services of type LoadBalancer.
You can deploy the Citrix solution for service of type LoadBalancer in AWS using Helm charts or YAML files.
Prerequisites
- Ensure that the Elastic Kubernetes Service (EKS) cluster version 1.18 or later is running.
- Ensure that NetScaler VPX and EKS are deployed and running in the same VPC. For information about creating NetScaler VPX in AWS, see Create a NetScaler VPX instance from AWS Marketplace.
Deploy Citrix solution for service of type LoadBalancer in AWS using Helm charts
Perform the following steps to configure the Citrix solution for service of type LoadBalancer using Helm charts.
-
Download the unified-lb-values.yaml file and edit the YAML file for specifying the following details:
-
NetScaler VPX NSIP. For more information, see NetScaler Ingress Controller Helm chart.
-
Secret created using the NetScaler VPX credentials. For more information, see NetScaler Ingress Controller Helm chart.
-
List of VIPs to be used in IPAM controller. For more information, see IPAM Helm chart.
-
-
Deploy and NetScaler Ingress Controller on your Amazon EKS cluster using the edited YAML file. Use the following commands:
helm repo add citrix https://citrix.github.io/citrix-helm-charts/ helm install serviceLB citrix/citrix-cloud-native -f values.yaml
-
Deploy the application and service in Amazon EKS:
-
Add the following annotation in the service manifest:
beta.kubernetes.io/aws-load-balancer-type: "external"
-
Deploy the application and service with the modified annotation using the following command:
kubectl create -f https://github.com/citrix/citrix-k8s-ingress-controller/blob/master/docs/how-to/typeLB/aws/guestbook-all-in-one-lb.yaml
Note: The
guestbook
microservice is a sample used in this procedure. You can deploy an application of your choice. Ensure that the service should be of type LoadBalancer and the service manifest should contain the annotation. -
Associate an elastic IP address with the VIP of NetScaler VPX.
-
Access the application using a browser. For example,
http://EIP-associated-with-vip
.
-
Deploy Citrix solution for service of type LoadBalancer in AWS using YAML
Perform the following steps to deploy the Citrix solution for service of type LoadBalancer using YAML.
-
Download the citrix-k8s-ingress-controller.yaml file and specify the following details.
-
Secret created using the NetScaler VPX credentials. For information about creating the secret, see Create a secret.
-
Specify the argument for :
args: - --ipam citrix-ipam-controller
-
Deploy the NetScaler Ingress Controller using the modified YAML.
kubectl create -f citrix-k8s-ingress-controller.yaml
-
Deploy the NetScaler VIP CRD which enables communication between the NetScaler Ingress Controller and the IPAM controller using the following command.
kubectl create -f https://raw.githubusercontent.com/citrix/citrix-k8s-ingress-controller/master/crd/vip/vip.yaml
For more information about deploying NetScaler VIP CRD, see Deploy the VIP CRD.
-
Deploy the IPAM controller. For information about deploying the IPAM controller, see Deploy the IPAM controller.
Note:
Specify the list of NetScaler VPX VIPs in the
VIP_RANGE
field of the IPAM deployment YAML file. -
Deploy the application with service type LoadBalancer in Amazon EKS using the following steps:
-
Add the following annotation in the service manifest.
beta.kubernetes.io/aws-load-balancer-type: "external"
-
Deploy the application and service with the modified annotation using the following command.
kubectl create -f https://github.com/citrix/citrix-k8s-ingress-controller/blob/master/docs/how-to/typeLB/aws/guestbook-all-in-one-lb.yaml
Note:
The
guestbook
microservice is a sample used in this procedure. You can deploy an application of your choice. Ensure that the service should be of type LoadBalancer and the service manifest should contain the annotation. -
Associate an elastic IP address with the VIP of NetScaler VPX.
-
Access the application using a browser. For example,
http://EIP-associated-with-vip
.
-