I deleted a portable subnet and now my Classic cluster my Load Balancers are failing. How do I recover?
Classic
your cluster is experiencing network errors.
A portable subnet was deleted.
Complete the following steps.
-
For the cluster that is experiencing issues, run the following command and make a note of the cluster ID.
ibmcloud ks cluster ls
-
List the subnets your cluster is using. In the output, make a note of the subnets that your cluster is using.
ibmcloud ks subnets --provider classic | grep CLUSTER-ID
-
List the subnets in your account. Check whether any subnets that you found in step 1 are missing from the list of subnets in your account. This means your cluster is using a subnet that was deleted, which is causing your Load Balancer to fail.
ibmcloud sl subnet list
ibmcloud sl subnet detail SUBNET-ID
-
For each subnet that was deleted, re-create it. If you need public IP addresses for your ALBs or LoadBalancers, specify the public VLAN ID of your worker nodes; for private IPs specify the private VLAN ID of your worker nodes.
ibmcloud ks cluster subnet create -c CLUSTER --size 8 --vlan VLAN-ID
-
Disable any ALBs that use the deleted portable subnets.
- List your ALBs and note the IDs of ALBS that you want to remove.
ibmcloud ks ingress alb ls -c CLUSTER-ID
- Disable the ALBs to delete the Load Balancer for the ALB, which releases the portable IP address in the portable subnet you want to detach
ibmcloud ks ingress alb disable -c CLUSTER-ID --alb ALB-ID
- List your ALBs and note the IDs of ALBS that you want to remove.
-
Complete the following steps to find any Load Balancers that use IP addresses from the deleted portable subnet(s), save their settings, and then delete them.
- Find the IP addresses your LoadBalancers use.
kubectl get svc -A -o wide | grep LoadBalancer
- For each Load Balancer that you identified earlier, run the following command to export it a YAML file.
kubectl get svc -o yaml -n LB-NAMESPACE LB-NAME > LB-NAMESPACE.LB-NAME.yaml
- After you saved the information to a YAML file, delete those LoadBalancers.
kubectl delete svc -n LB-NAMESPACE LB-NAME
- Find the IP addresses your LoadBalancers use.
-
Detach the deleted portable subnets from your cluster with the following command.
ibmcloud ks cluster subnet detach -c CLUSTER --subnet-id SUBNET-ID
-
Wait a few minutes for the detach command to finish, then check that they have been detached by reviewing the
ibm-cloud-provider-vlan-ip-config
ConfigMap that stores the subnets and IP addresses.kubectl get cm -n kube-system ibm-cloud-provider-vlan-ip-config -o yaml
It might take 5-10 minutes for the detach to complete. While you wait, you can ensure that the new portable subnets you created for this cluster also appear in the ConfigMap.
-
Create ALBs by using the following command. Note that you can't re-enable the old ALBs because they still use the deleted portable subnet.
ibmcloud ks ingress alb create classic --cluster CLUSTER-ID --type public|private --zone ZONE --vlan VLAN-ID
-
Re-create the LoadBalancers that you deleted by using the YAML file that you saved earlier.
kubectl apply -f LB-NAMESPACE.LB-NAME.yaml