tencent cloud

Feedback

Multi-Region Ingress

Last updated: 2023-06-01 11:22:54

    Scenarios

    In the case of distinguishing multiple regions in edge nodes, each region has an independent network architecture and needs to provide Ingress service capabilities externally in the local region. Based on the concept of NodeUnit, TKE-Edge supports the ability to create Nginx-Ingress-Controller in different regions in the product. At the same time, through the application-grid-wrapper component, the Ingress-Controller's access to pods can be restricted within the local region (NodeUnit range). The specific architecture is shown in the following figure:
    
    
    

    Operation Steps

    1. Log in to the TKE console.
    2. On the cluster management page, click the cluster ID to enter the cluster details page.
    3. Select "Add-on management" and enter the add-on list page.
    4. Click "Create", enter the "Create add-on" page.
    5. Select "NginxIngress" and click "Done", as follow:
    
    
    
    6. Wait for the add-on is ready, as follow:
    
    
    
    7. Click "ingressnginx" and enter the detailed page. As follow:
    
    
    
    8. Click "Add Nginx Ingress instance", and create Nginx-Ingress-Controller at specified NodeUnit, for example in bj NodeUnit:
    
    
    
    NginxIngress name: Specifies the name of the deployed Ingress-Ingress-Controller instance, which creates the corresponding daemonset.
    Namespace: Currently set to listen to Ingress resources in all namespaces by default.
    Deployment modes: Currently, the default deployment mode is using DaemonSet. The user must manually choose one or more nodes under the NodeUnit to provide the Ingress Controller service.
    Node Pool: Select the NodeUnit where you want to deploy, and then choose the nodes on which you want to deploy the Nginx-Ingress-Controller service.
    Caution:
    Make sure that the selected nodes have ports 80 and 443 available, as they should not be occupied. Otherwise, the Nginx-Ingress-Controller may fail to start.
    9. After clicking "Confirm", you can view the created Ingress-Controller instance, as shown in the following image:
    
    
    
    10. By checking the component details, you can confirm the current deployment status of the controller. Once the number of running Pods reaches the expected count, it indicates that the deployment has succeeded, as shown in the following image:
    
    
    
    

    Deploy Service and Access it Using Ingress:

    1. Here we take the Nginx service as an example, creating a Deployment where the Pods will be deployed to the beijing and guangzhou regions, as shown in the image below:
    
    
    
    Then use the ServiceGrid to provide internal access to the deployed service:
    
    
    
    
    In this scenario, we expect that when accessing Ingress from the Beijing region, only the Pods in the Beijing region will be accessed, for example, nginx-beijing-76cdbbc899-k66c8, and it won't access the Pods in the Guangzhou region.
    2. To create an Ingress, navigate to the cluster details page "Services" > "Ingress", and click "Create". As shown in the image below:
    
    
    
    3. Enter the required Ingress information, as shown in the following image:
    
    
    
    Ingress name: Enter the name for the Ingress you want to create.
    Description: Enter a descriptive remark.
    Ingress type: Currently, only the Nginx Ingress Controller type is supported by default.
    Namespace: Specify the namespace to create this Ingress.
    Node Pool: Choose the Ingress-Controller to be bound to this Ingress, which refers to the Nginx-Ingress-Controller instance deployed earlier.
    Forwarding Configuration: Input the specific configuration for the service here. For example, entering a custom domain name test.k8s.io, path set to echo, and backend service pointing to the previously created nginx-svc.
    4. Access the Ingress service within the corresponding region. For example, in the Beijing region, access http://test.k8s.io/echo, as shown in the image below:
    
    
    
    You can perform multiple access tests and find that all accesses will be restricted to the Pods within the Beijing region, and will not access the Pods in the Guangzhou region. This demonstrates the effectiveness of the Ingress and ServiceGroup configuration in managing traffic and ensuring that interactions remain within the specified NodeUnit and region.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support