Skip to content

Latest commit

 

History

History
132 lines (91 loc) · 4.33 KB

cn-delete.md

File metadata and controls

132 lines (91 loc) · 4.33 KB
copyright lastupdated keywords subcollection
years
2024, 2025
2025-02-05
vpc

{{site.data.keyword.attribute-definition-list}}

Deleting a cluster network

{: #delete-cluster-network}

You can delete a cluster network interface after all instances attached to it are deleted. {: shortdesc}

Before you begin

{: #delete-cluster-network-prerequisites}

Review Planning considerations and Known issues and limitations.

You can delete a cluster network with the UI, CLI, API, or Terraform.

Deleting a cluster network in the UI

{: #delete-cluster-network-ui} {: ui}

To delete a cluster network in the {{site.data.keyword.cloud_notm}} console, follow these steps:

  1. From your browser, open the {{site.data.keyword.cloud_notm}} console and log in to your account.

  2. Select the Navigation Menu Navigation Menu icon, then click Infrastructure VPC icon > Cluster networks.

  3. In the Cluster networks for VPC table, locate the cluster network interface that you want to delete, then click Delete in the Actions menu Actions menu.

    Alternatively, you can Delete a cluster network from the Actions menu on the cluster network's details page.

Deleting a cluster network in the CLI

{: #delete-cluster-network-cli} {: cli}

To delete a cluster network in the CLI, follow these steps:

  1. Set up your CLI environment.

  2. Log in to your account with the CLI. After you enter the password, the system prompts for the account and region that you want to use:

    ibmcloud login --sso

    {: pre}

  3. To delete one or more cluster networks, enter the following command:

    ibmcloud is cluster-network-delete (CLUSTER_NETWORK1 CLUSTER_NETWORK2...) [--output JSON]  [-f, --force] [-q, --quiet]

    {: pre}

    Where:

    CLUSTER_NETWORK1 CLUSTER_NETWORK2 : IDs or names of the cluster networks, separated by a space.

    -output : Specify output format, only JSON is supported. One of: JSON.

    -force, -f : Force the operation without confirmation.

    -q, --quiet : Suppress verbose output.

Command example

{: #command-examples-cluster-network-delete}

To delete cluster network cli-cn-1. You are prompted for confirmation. This action cannot be undone.

ibmcloud is cluster-network-delete cli-cn-1

{: codeblock}

Deleting a cluster network with the API

{: #delete-cluster-network-api} {: api}

To delete a cluster network with the API, follow these steps:

  1. Set up your API environment with the right variables.

  2. Store any additional variables to be used in the API commands; for example:

    version (string): The API version, in format YYYY-MM-DD.

  3. When all variables are initiated, run the following command delete the cluster network:

    curl -X DELETE   "$vpc_api_endpoint/v1/cluster_networks/$cluster_network_id?version=$tomorrow&generation=2&maturity=development" -H "Authorization: Bearer $iam_token"

    {: codeblock}

To view the complete set of cluster network APIs, see the VPC API reference.

Deleting a cluster network with Terraform

{: #delete-cluster-network-terraform} {: terraform}

Use the terraform destroy command to delete a cluster network. The following example deletes ibm_is_cluster_network.

terraform destroy --target ibm_is_cluster_network

{: codeblock}

You can also delete a resource that was created with a .tf file. For example, if you created a cluster with the following .tf file (terraform apply -auto-approve), you can delete it using terraform destroy auto-approve.

// Provision is_cluster_network resource instance
resource "ibm_is_cluster_network" "is_cluster_network_instance" {
  name            = var.is_cluster_network_name  // change to update
  profile         = "h100"
  resource_group  = "fee82deba12e4c0fb69c3b09d1f12345"
  subnet_prefixes {
    cidr = "10.0.0.0/24"
  }
  vpc             = "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"
  zone            = "us-south-1"
}

{: codeblock}