Kubernetes Gateway API is the next-generation ingress and traffic routing mechanism designed to improve extensibility, and standardization over the older Ingress
API. This KB helps you understand how to convert existing Ingress resources to Gateway API using GatewayClass, using SWIFT. Also we will see how Gateway annotation will be done.
Suppose in your source cluster having ingress and you wish to convert it to gatewayClass into target, then you can follow below steps in SWIFT.
Pre-requisite:
1. Ingress controller must be deployed on the source cluster along with ingress object with service.
Points Covered:
Ingress-to-Gateway conversation
1. Login to SWIFT dashboard.
2. Go to the 'All Replication' under Sync administration, then click on 'New' and 'Application Replication' and choose 'Passthrough Replication'
3. Then you will prompted below screen and select your source cluster and destination cluster along with namespace. And then select the rest of the options as per your environment.
4. Now you will see a new Tab i.e. 'Advanced Options', you need to open that tab and click on 'Kubernetes Ingress Config' , in that there you will get third tab , that is 'Ingress to Gatewayclass Mapping' and select ingress nginx at source side and choose any gateway that are present in GKE cluster.
5. Once you click on '+' button , it will be mapped like below.
6. Once you click on add button , then sync will be started. Please find below screenshort for your reference that sync has been completed.
7. Now it will be converted 'ingress' to 'gateway' and 'httproute' and that gateway will use specified gatewayClass at target.
#Please see below output of the target cluster, the successfully converted the ingress to gatewayclass with the same ingress name.
#Nginx application successfully accessible with above 'ADDRESS' (34.55.44.201).
#Also httproute will be created at target cluster.
Gateway Annotation Mapping
1. For this you have already created ingress, that need to be selected in 'Gateway Annotation Mapping' tab . In the Target box, you just need to select the ingress and below section , you will have to provide Annotations in key: value format.
2. We have provided the annotation key value with ingress and mapped like above screenshot. Once click on add button , sync will started and mapping has been done.
3. Please check below screenshot to check if annotation is mapped correctly or not. For this, you just need to edit the gateway yaml and check at target side, if given annotation has been reflected or not?
4. As you can check below screenshot, that , it was getting reflected correctly.
Note: Please find below the Gateway installation links for each cloud provider. The Gateway must be deployed in the target cluster, as it is a prerequisite for this configuration.
For GKE: https://cloud.google.com/kubernetes-engine/docs/how-to/deploying-gateways
For NGINX: https://docs.nginx.com/nginx-gateway-fabric/install/helm/
For EKS: https://www.gateway-api-controller.eks.aws.dev/latest/guides/deploy/