Updated on 2024-01-04 GMT+08:00

Creating a Kubernetes Cluster

Context

This section describes how to quickly create a CCE cluster. In this example, the default or simple configurations are in use.

Creating a Cluster

  1. Log in to the CCE console.

    • If you have no clusters, click Create under CCE Standard Cluster on the wizard page.
    • If your have CCE clusters, choose Clusters in the navigation pane, click Buy Cluster and select the CCE standard cluster.

  2. On the Buy CCE Standard Cluster page, configure parameters as prompted.

    In this example, a majority of parameters retain default values. Only mandatory parameters are described. For details, see Table 1.
    Table 1 Parameters for creating a cluster

    Parameter

    Description

    Basic Settings

    *Cluster Name

    Name of the cluster to be created. A cluster name contains 4 to 128 characters starting with a lowercase letter and not ending with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

    *Enterprise Project

    This parameter is displayed only for enterprise users who have enabled Enterprise Project Management.

    *Cluster Version

    Choose the latest version.

    *Cluster Scale

    Maximum number of worker nodes that can be managed by the cluster. If you select Nodes: 50, the cluster can manage a maximum of 50 worker nodes.

    *HA

    The default value is Yes.

    Network Settings

    *Network Model

    You can select VPC network or Tunnel network. Retain the default value.

    *VPC

    VPC where the cluster will be located.

    If no VPC is available, click Create VPC to create one. After the VPC is created, click the refresh icon.

    *Master Node Subnet

    Subnet where master nodes of the cluster are located.

    *Container CIDR Block

    CIDR block used by containers. The value determines the maximum number of containers in the cluster.

    Retain the default value.

    *IPv4 Service CIDR Block

    CIDR block for Services used by containers in the same cluster to access each other. The value determines the maximum number of Services you can create. The value cannot be changed after creation.

    Retain the default value.

  3. Click Next: Configure Add-on. Retain the default settings.
  4. Click Next: Confirm. The cluster resource list is displayed. Confirm the information and click Submit.

    It takes about 6 to 10 minutes to create a cluster.

    The created cluster will be displayed on the Clusters page, and the number of nodes in the cluster is 0.

Creating a Node

After a cluster is created, you need to create nodes in the cluster to run workloads.

  1. Log in to the CCE console.
  2. Click the name of the created cluster to access the cluster console.
  3. In the navigation pane, choose Nodes. Click the Nodes tab, click Create Node in the upper right corner, and configure parameters as prompted.

    The following describes only important parameters. For other parameters, retain the defaults.

    Compute Settings

    • AZ: Keep the default.
    • Node Type: Select Elastic Cloud Server (VM).
    • Specifications: Select node specifications that fit your business needs.
    • Container Engine: Select a container engine as required.
    • OS: Select the operating system (OS) of the nodes to be created.
    • Node Name: Enter a node name.
    • Login Mode:
      • If the login mode is Password, the default username is root. Enter the password for logging to the node and confirm the password.

        Keep the password secure. If you forget the password, the system is unable to retrieve it and you will have to reset the password.

      • If the login mode is Key Pair, select a key pair for logging to the node and select the check box to acknowledge that you have obtained the key file and without this file you will not be able to log in to the node.

        A key pair is used for identity authentication when you remotely log in to a node. If no key pair is available, click Create Key Pair.

    Storage Settings

    • System Disk: Configure the disk type and capacity based on your requirements. The default disk capacity is 50 GiB.
    • Data Disk: Configure the disk type and capacity based on your requirements. The default disk capacity is 100 GiB.

    Network Settings

    • VPC: Use the default VPC, which is, the subnet selected during cluster creation.
    • Node Subnet: Select a subnet in which the node runs.
    • Node IP: Select Random. The node IP indicates the private IP address of the node.
    • EIP: enables public network access. After an EIP is bound, the node can access the Internet, for example, downloading images from an external repository.

      The default value is Do not use. You can also select Use existing or Auto create.

  4. At the bottom of the page, select the node quantity, and click Next: Confirm.
  5. Review the node specifications, read the instructions, select I have read and understand the preceding information, and click Submit.

    It takes about 6 to 10 minutes to create a node.

    The created node will be displayed on the Nodes page.