All Products
Search
Document Center

Container Service for Kubernetes:Configure an ENI filter

Last Updated:Aug 02, 2023

If you use the Terway network plug-in, the elastic network interfaces (ENIs) of the nodes in your cluster are managed by Terway. If you want to manually manage some ENIs, you need to configure an ENI filter to specify the ENIs that are managed by Terway. Otherwise, conflicts occur when you and Terway manage the same ENI. After you configure an ENI filter, only ENIs that match the specified tags of the filter are managed by Terway. This topic describes how to configure an ENI filter.

Table of contents

Prerequisites

A Container Service for Kubernetes (ACK) managed cluster is created. The cluster uses the Terway network plug-in. For more information, see Create an ACK managed cluster.

Limits

The version of Terway is 1.5.5 or later. For more information about how to update a component, see Manage components.

Procedure

  1. Run the following command to modify the configuration file of Terway:

    kubectl edit cm -n kube-system eni-config
  2. Add the following content to the eni_conf field:

     "eni_tag_filter":  { "creator": "terway" }

    The "eni_tag_filter" parameter indicates an ENI tag filter. The { "creator": "terway" } tag specifies all ENIs that are created by Terway.

    Sample code:

     eni_conf: |
        {
          "eni_tag_filter":  { "creator": "terway" },
          "ip_stack": "ipv4",
          "vswitch_selection_policy": "ordered"
         }

  3. Run the following command to restart Terway for the configuration to take effect:

    kubectl delete pod -nkube-system -l app=terway-eniip

    Expected output:

    pod "terway-eniip-XXX" deleted
  4. Confirm that the configuration is in effect.

    1. Run the following command to check the status of terway-eniip:

      kubectl get pods -n kube-system -l app=terway-eniip

      Expected output:

      NAME                 READY   STATUS    RESTARTS   AGE
      terway-eniip-XXX   2/2     Running   0          19h
    2. Run the following command to view the configuration of Terway:

      kubectl logs -nkube-system terway-eniip-XXX

      If the output contains the following content, the new configuration is in effect:

      #The ENITagFilter parameter indicates an ENI tag filter, and the creator:terway tag specifies all ENIs that are created by Terway. 
      ENITagFilter:map[creator:terway]