Skip to content

Latest commit

 

History

History
160 lines (112 loc) · 5.93 KB

cn-create-subnet.md

File metadata and controls

160 lines (112 loc) · 5.93 KB
copyright lastupdated keywords subcollection
years
2024
2024-10-15
vpc

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

Creating a cluster network subnet

{: #create-cluster-network-subnet}

Contact your IBM Support representative if you are interested in getting early access to this offering. It is currently available for early access users of the gx3d-160x1792x8h100 virtual server instance profiles in the us-east region. {: beta}

A cluster network subnet is a subnet within a cluster network. While it resembles a VPC subnet, it offers fewer features. However, it does let you define the subnet CIDR and configure reserved IPs for the cluster network subnet. These reserved IPs include addresses you specify and come with an auto-delete function similar to that of VPC subnet reserved IPs. {: shortdesc}

Before you begin

{: #create-subnet-prerequisites}

Review Planning considerations and Known issues and limitations.

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

Creating a cluster network subnet in the UI

{: #create-cluster-network-subnet-ui} {: ui}

To create a subnet within a network cluster in the UI, follow these steps:

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

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

  3. On the Cluster networks for VPC page, click the link of the cluster network name where you want to create a subnet. The Overview page displays.

  4. Click the Subnets tab to show the Cluster network subnets table, then click Create +.

  5. Complete the information in the Create subnet side panel, then click Create.

    • Enter a subnet name.
    • Review the address prefix. Change as needed.
    • Select the number of total IP addresses (default is 256).
    • Review the IP range stated. Change as needed.
    • Review the specified address space. Adjust the IP range as needed.

The cluster network subnet is requested for use.

Creating a cluster network subnet in the CLI

{: #create-cluster-network-subnet-cli} {: cli}

To create a cluster network subnet 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. Enable the following feature flag:

    export IBMCLOUD_IS_FEATURE_CLUSTER_NETWORK=true

    {: pre}

  4. To create a cluster network subnet, enter the following command:

    ibmcloud is cluster-network-subnet-create CLUSTER_NETWORK (--total-ipv4-address-count TOTAL_IPV4_ADDRESS_COUNT | --ipv4-cidr-block IPV4_CIDR_BLOCK) [--name NAME] [--ip-version IP_VERSION] [--output JSON] [-q, --quiet]

    {: pre}

    Where:

    CLUSTER_NETWORK : ID or name for the cluster network.

    --total-ipv4-address-count : The total number of IPv4 addresses required. Must be a power of 2.

    --ipv4-cidr-block : The IPv4 range of the cluster network subnet, expressed in CIDR format.

    --name : The name for this cluster network subnet.

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

    -q, --quiet : Suppress verbose output.

Command example

{: #command-example-create-cluster-network-subnets}

To create a cluster network subnet with name cli-cn-sub-1 for cluster network cli-cn-1:

ibmcloud is cluster-network-subnet-create cli-cn-1 --name cli-cn-sub-1 --total-ipv4-address-count 32

{: codeblock}

Related commands

{: #related-commands-cluster-network-subnets}

[WHEN AVAILABLE WILL LINK TO COMMAND REFERENCE]{: tag-red}

  • List all cluster network subnets
  • View details of a cluster network subnet
  • Update a cluster network subnet
  • Delete one or more cluster network subnets

Creating a cluster network subnet with the API

{: #create-cluster-network-subnet-api} {: api}

To create a cluster network subnet 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 to create the cluster network subnet:

    curl -X POST "$vpc_api_endpoint/v1/cluster_networks/$cluster_network_id/subnets?version=$tomorrow&generation=2&maturity=development" -H "Authorization: Bearer $iam_token" -d '{
          "name": "my-cluster-network-subnet",
          "total_ipv4_address_count": 2048
        }'

    {: codeblock}

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

Creating a cluster network subnet with Terraform

{: #create-cluster-network-subnet-terraform} {: terraform}

Terraform will support this feature after it reaches General Availability (GA) and is officially released. {: note}

The following example provisions a cluster network subnet by using Terraform:

resource "ibm_is_cluster_network_subnet" "is_cluster_network_subnet_instance" {
  cluster_network_id        = var.is_cluster_network_subnet_cluster_network_id
  ip_version                = var.is_cluster_network_subnet_ip_version
  name                      = var.is_cluster_network_subnet_name
  total_ipv4_address_count  = var.is_cluster_network_subnet_total_ipv4_address_count
  // ipv4_cidr_block = var.is_cluster_network_subnet_ipv4_cidr_block #conflicts with total_ipv4_address_count
}

{: codeblock}