You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "ps-19 (via GitHub)" <gi...@apache.org> on 2023/04/06 04:56:43 UTC

[GitHub] [apisix-ingress-controller] ps-19 commented on issue #420: add examples about migrating from nginx ingress controller

ps-19 commented on issue #420:
URL: https://github.com/apache/apisix-ingress-controller/issues/420#issuecomment-1498491357

   @lxm any feedback?
   
   ## Identify the annotations used in the nginx ingress controller that you want to migrate.
   Before you can migrate from nginx ingress controller to Apisix-ingress, you'll need to identify the annotations used in your nginx ingress controller configuration that you want to migrate. You can do this by examining your Kubernetes manifests and looking for annotations that have the prefix "nginx.ingress.kubernetes.io/". Take note of the names and values of these annotations.
   
   ## Check if the annotations are supported in Apisix-ingress.
   
   Once you have identified the annotations you want to migrate, check if they are supported in Apisix-ingress. Apisix-ingress has its own set of annotations, which can be found in the official documentation. If an annotation you want to migrate is not listed, you may need to find an alternative solution or implement custom functionality in Apisix-ingress.
   
   ## Replace the nginx ingress controller annotations with the corresponding annotations supported by Apisix-ingress.
   
   Once you have identified the Apisix-ingress annotations that correspond to the nginx ingress controller annotations you want to migrate, you'll need to update your Kubernetes manifests to use the Apisix-ingress annotations instead. Be sure to update the values of the annotations as well, if necessary.
   
   For example, if you have an nginx ingress controller annotation like this:
   
   ```bash
   nginx.ingress.kubernetes.io/rewrite-target: /$1
   ```
   You can replace it with the following Apisix-ingress annotation:
   
   ```bash
   apisix.apache.org/rewrite-target: /$1
   ```
   
   ## Update your Kubernetes manifests to use the Apisix-ingress resource.
   
   Next, you'll need to update your Kubernetes manifests to use the Apisix-ingress resource instead of the nginx ingress controller resource. The Apisix-ingress resource is similar to the Kubernetes Ingress resource, but with additional features and functionality.
   
   Here's an example Apisix-ingress resource:
   
   ```yaml
   apiVersion: apisix.apache.org/v2alpha1
   kind: ApisixIngress
   metadata:
     name: my-ingress
   spec:
     rules:
       - host: example.com
         http:
           paths:
             - path: /foo
               pathType: Prefix
               backend:
                 service:
                   name: foo-service
                   port:
                     name: http
   ```
   ## If you have existing Kubernetes Ingress resources, you can migrate them to ApisixRoute resources.
   
   If you have existing Kubernetes Ingress resources that you want to migrate to Apisix-ingress, you can do so by creating a new ApisixRoute resource with the same configuration as the Ingress resource, and then deleting the Ingress resource.
   
   Here's an example ApisixRoute resource that's equivalent to the example Apisix-ingress resource shown above:
   
   ```yaml
   apiVersion: apisix.apache.org/v2alpha1
   kind: ApisixRoute
   metadata:
     name: my-route
   spec:
     rules:
       - host: example.com
         http:
           paths:
             - path: /foo
               pathType: Prefix
               backend:
                 service:
                   name: foo-service
                   port:
                     name: http
   ```
   
   ## Update your documentation to reflect the changes you've made.
   
   Finally, you'll need to update your documentation to reflect the changes you've made. This should include instructions for using the new Apisix-ingress annotations and resources, as well as any other relevant information about the migration process.
   
   By following these steps, you should be able to migrate from nginx ingress controller to Apisix-ingress with minimal disruption


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org