July 31, 2019 By Brandon Palm 2 min read

There is a new command to help manage public and private portable subnet resources.

In version 0.3.95 of the IBM Cloud Kubernetes Service CLI plug-in, a new command is introduced to help you manage the public and private portable subnet resources attached your clusters in the IBM Cloud Kubernetes Service:

ibmcloud ks cluster-subnet-detach

If you no longer need subnets from your IBM Cloud classic infrastructure account that you added to a cluster, you can now use this command to easily detach those subnets from your cluster. When you remove a subnet, it is no longer available to your cluster, but it still exists in your IBM Cloud classic infrastructure account.

Listing subnets

After logging in through the IBM Cloud CLI, you can list all existing portable subnets that are available in your IBM Cloud classic infrastructure account by running:

ibmcloud ks subnets

Example output:

ID        Network             Gateway          VLAN ID   Type      Bound Cluster

...

1602829   169.1.1.1/29        169.1.1.2        2234945   public    df253b6025d64944ab99ed63bb4567b6

In the output, note the ID of the subnet and the cluster ID in the Bound Cluster field to use in the detach command. (Note: If you need to find the ID of a cluster, you can run ibmcloud ks clusters.) 

You can further determine which subnets are attached to a cluster by running ibmcloud ks cluster-get --cluster CLUSTER_NAME_OR_ID --showResources and looking for the Subnet CIDRs in the Subnets VLANs section in the output.

Detaching subnets

To detach the subnet, run the following command:

ibmcloud ks cluster-subnet-detach --cluster CLUSTER --subnet-id SUBNET_ID [-f] [-s]

Subnets can only be detached from a cluster if none of the IPs derived from that subnet range are in use in your cluster.

After the subnet is detached, it still remains available in your IBM Cloud account for use with other clusters. If you want to attach it to another cluster, you can run the following command:

ibmcloud ks cluster-subnet-add --cluster CLUSTER_NAME_OR_ID --subnet-id SUBNET_ID

Safely deleting subnets

Now that your subnets are safely detached, you can delete the subnets without causing issues in your Kubernetes cluster. To delete a subnet from your IBM Cloud classic infrastructure account, use the following command:

ibmcloud sl subnet cancel SUBNET_ID

Now, when you run ibmcloud ks subnets, the subnet will no longer appear in the output.

More details

More information can be found in the IBM Cloud Kubernetes Service documentation.

Contact us

If you have questions, engage our team via Slack by registering here and join the discussion in the #general channel on our public IBM Cloud Kubernetes Service Slack.

Was this article helpful?
YesNo

More from Cloud

IBM Cloud Virtual Servers and Intel launch new custom cloud sandbox

4 min read - A new sandbox that use IBM Cloud Virtual Servers for VPC invites customers into a nonproduction environment to test the performance of 2nd Gen and 4th Gen Intel® Xeon® processors across various applications. Addressing performance concerns in a test environment Performance testing is crucial to understanding the efficiency of complex applications inside your cloud hosting environment. Yes, even in managed enterprise environments like IBM Cloud®. Although we can deliver the latest hardware and software across global data centers designed for…

10 industries that use distributed computing

6 min read - Distributed computing is a process that uses numerous computing resources in different operating locations to mimic the processes of a single computer. Distributed computing assembles different computers, servers and computer networks to accomplish computing tasks of widely varying sizes and purposes. Distributed computing even works in the cloud. And while it’s true that distributed cloud computing and cloud computing are essentially the same in theory, in practice, they differ in their global reach, with distributed cloud computing able to extend…

How a US bank modernized its mainframe applications with IBM Consulting and Microsoft Azure

9 min read - As organizations strive to stay ahead of the curve in today's fast-paced digital landscape, mainframe application modernization has emerged as a critical component of any digital transformation strategy. In this blog, we'll discuss the example of a US bank which embarked on a journey to modernize its mainframe applications. This strategic project has helped it to transform into a more modern, flexible and agile business. In looking at the ways in which it approached the problem, you’ll gain insights into…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters