Updated on 2023-09-26 GMT+08:00

Managing an EIPPool

Updating an EIPPool

Currently, you can only adjust the number of EIPs in an EIPPool, that is, scale in or out an EIPPool. If you want to modify other EIP parameters, create an EIPPool to replace the existing one in the workload configuration.

During EIPPool scale-in, if resources of an EIP are occupied, the EIP will not be deleted until the resources are released.

In the following example of the dynamic EIPPool eippool-demo1, change amount: 3 to amount: 5.
apiVersion: crd.yangtse.cni/v1     
kind: EIPPool                     
metadata:                          
  name: eippool-demo1
  namespace: xxx        
spec:
  amount: 5                        # Number of EIPs in the EIPPool
  eipAttributes:                   # EIP attributes
 ...  

Run the following command to view the EIPPool details. (-n indicates the namespace to which the EIPPool belongs.)

In the command output, if the USAGE value of eippool-demo1 changes from 0/3 to 0/5, the EIPPool is successfully updated.

# kubectl get eippool -n $namespace_name
NAME                   EIPS           USAGE         AGE
eippool-demo1                         0/5           39m

As shown in the following example of the static EIPPool eippool-demo2, updating an EIPPool is to add or delete public IP addresses managed by the EIPPool.

apiVersion: crd.yangtse.cni/v1
kind: EIPPool                  # Type of the created object
metadata:                      # Metadata definition of the resource object
  name:eippool-demo2
spec:                          # EIPPool configuration
  eips:                        # Public IP addresses to be managed
  - 10.246.173.254  
  - 10.246.172.3 
  - 10.246.172.59

Deleting an EIPPool

When an EIPPool is deleted, its EIPs are also deleted. If an EIP in the EIPPool is occupied by a pod or other resources, you cannot delete the EIPPool.