Migrate Terway EIPs to ack-extend-network-controller

更新时间:
复制 MD 格式

Terway EIP is deprecated and no longer maintained. Use the ack-extend-network-controller add-on for EIP. This topic guides you through migrating EIPs from Terway to ack-extend-network-controller without service disruption.

Prerequisites

Impact

Important

Migration is non-disruptive and does not affect EIP information or workloads.

  • If your cluster uses Terway EIPs, follow this guide to migrate to ack-extend-network-controller.

  • If your cluster does not use Terway EIPs, skip this migration.

Migration overview

When you enable EIP migration in Terway, Terway creates a PodEIP resource for each EIP associated with a pod. A PodEIP manages EIP information for a pod. After migration, ack-extend-network-controller takes over EIP management.

To enable the EIP feature in Terway, see Automatic EIP assignment use cases.

Procedure

  1. Verify that ack-extend-network-controller is not installed in your cluster. If it is, uninstall it.

    1. Log on to the ACK console. In the left navigation pane, click Clusters.

    2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Applications > Helm.

    3. On the Helm page, find the Release Name ack-extend-network-controller. If it exists, click Delete in the Actions column to uninstall it.

  2. Upgrade the Terway network plugin to v1.6.0 or later.

    See Manage components.

  3. Modify the Terway ConfigMap to enable EIP migration.

    Important

    When you enable EIP migration, Terway creates a PodEIP resource for each EIP associated with a pod and stops managing EIPs.

    1. Edit the Terway ConfigMap:

      kubectl edit cm eni-config -n kube-system
    2. Modify the configuration in eni_conf.

      Parameter

      Value

      Description

      enable_eip_pool

      "true"

      If not configured or set to "false", the eip feature is not enabled and no migration is required.

      enable_eip_migrate

      true

      Set to true to enable migration.

      Configuration example. Do not modify other parameters.

      # The preceding content is omitted.
        eni_conf: |
          {
            "version": "1",
            "enable_eip_pool": "true",
            "enable_eip_migrate": true,
            "vswitch_selection_policy": "ordered"
          }
      # The following content is omitted.
    1. After modifying the configuration, restart the Terway pods:

      kubectl delete pod -n kube-system -l app=terway-eniip

      After the pods restart, Terway automatically migrates cluster EIPs to ack-extend-network-controller.

  4. Check migration status in the Terway logs. The output eip migrate finished indicates success.

    1. Get the Terway pod names:

      kubectl get pods -n kube-system | grep terway

      The output lists the Terway pod names.

    2. View the logs of a Terway pod:

      kubectl logs -n kube-system <pod_name> # Replace <pod_name> with the name of your Terway pod.

      eip migrate finished in the output confirms the migration is complete.

      Ds:[sg-2ze360hfgjtsemo2wyyj] InstanceID:i-2zed                              5 VSwitchSelectionPolic
      I1013 03:44:40.082505 daemon.go:1596] subSys=network-service eip migrate finished
  5. Verify that PodEIP custom resources (CRs) were created in the cluster.

    Query a migrated CR. Each CR shares the name and namespace of its corresponding pod.

    kubectl get podeip -n {namespace} {name} # Replace {namespace} and {name} with the namespace and name of the pod associated with an EIP.
  6. Install ack-extend-network-controller from the Marketplace and enable the EIP feature. See Install ack-extend-network-controller from the Marketplace.

  7. Check whether the PodEIP resource status is updated:

    kubectl get podeip -n {namespace} {name} -o yaml # Replace {namespace} and {name} with the namespace and name of the pod associated with an EIP.
    • A non-empty status field indicates the EIP function is running correctly.

    • An empty status field indicates a problem. Check ack-extend-network-controller configuration and logs.

    Example output:

    Example PodEIP output

    apiVersion: alibabacloud.com/v1beta1
    kind: PodEIP
    metadata:
      creationTimestamp: "2023-10-24T08:24:37Z"
      finalizers:
      - podeip-controller.alibabacloud.com/finalizer
      generation: 1
      name: example-xxx-xx
      namespace: default
      resourceVersion: "44013"
      uid: 4744a7af-***-***-ad06-***17aecce
    spec:
      allocationID: eip-xxxxxx
      allocationType:
        releaseStrategy: Follow
        type: Auto
    status:
      eipAddress: 47.XX.XX.XX
      internetChargeType: PayByTraffic
      isp: BGP
      networkInterfaceID: eni-xxxxxxx
      podLastSeen: "2023-10-24T08:31:22Z"
      privateIPAddress: 192.XX.XX.XX
      resourceGroupID: rg-xxxxxx
      status: InUse

    Parameters:

    Parameter

    Description

    spec.allocationType.type

    • Static: The pod uses a specified EIP ID.

    • Auto: Terway automatically creates the EIP.

    spec.allocationType.releaseStrategy

    • Follow: The EIP is released when the pod is deleted. For stateless workloads, EIP-pod association is not maintained.

    • TTL: The EIP is released after a specified duration. Use this to maintain EIP-pod association for stateful workloads.

  8. To disable the EIP feature in Terway:

    1. Set enable_eip_migrate to false, or delete it.

    2. Set enable_eip_pool to "false" or delete it.

    3. Restart the Terway pods.