Create the global Cluster on Huawei Cloud Stack

Prerequisites

Procedure

1. Write install-config.yaml

Create an installation directory on the bootstrap node, for example /root/global-install, and write install-config.yaml in it. The commands on this page call this directory <install-dir>; see Installation Directory. Keep the file private (chmod 600 install-config.yaml), because it holds the passwords.

Copy the following template and fill in the placeholders. The numbered lines are specific to Huawei Cloud Stack and are described in the table below the template. For the other fields, see Common install-config.yaml Fields. For the objects that ac renders from this file, see Rendered Manifests.

install-config.yaml
global:
  registry:
    address: <host>:<port>
    username: <user>
    password: <password>
  platform:
    address: <platform-domain-or-ip>
    username: admin@cpaas.io
    password: <password>
    extraAddresses: []
    cert:
      certificateFile: <console-cert-file>
      privateKeyFile: <console-key-file>
      # pkcs12CertificateFile: <console-pkcs12-file>
      # pkcs12Password: <password>

cluster:
  sshKeys:
    - <ssh-public-key>
  ntpServers: []
  network:
    podCIDR: 10.199.0.0/16
    serviceCIDR: 10.96.0.0/12
    kubeOVN:
      joinCIDR: 100.64.0.0/16

provider:
  hcs:
    credential:
      accessKey: <access-key>
      secretKey: <secret-key>
      projectID: <project-id>
      region: <region>
      externalGlobalDomain: <domain>
      schema: https
    imageName: <image-name>
    flavorName: <flavor-name>
    # availabilityZone: <az>
    network:
      vpcName: <vpc-name>
      securityGroupName: <security-group>
      subnetName: <primary-subnet>
    elb:
      vipAddress: <control-plane-vip>
      # vipSubnetName: <vip-subnet-name>
      l4:
        # subnetName: <subnet-name>
        ips: [<l4-ip-1>, <l4-ip-2>]
      l7:
        # subnetName: <subnet-name>
        ips: [<l7-ip-1>, <l7-ip-2>]
    rootDisk:
      type: SSD
      sizeGiB: <root-disk-gib>
    diskType: SSD
    # controlPlaneHA:
    #   enabled: true
    #   policy: soft-anti-affinity

controlPlane:
  replicas: 3
  deployMode: normal
  # hcs:
  #   flavorName: <flavor-name>
  #   availabilityZone: <az>
  #   subnetName: <subnet-name>
  #   rootDisk:
  #     type: SSD
  #     sizeGiB: <root-disk-gib>
  network:
    additions: []
    # additions:
    #   - hcs:
    #       subnetName: <additional-subnet>
  disks:
    ephemeral:
      - name: var-lib-containerd
        sizeGiB: 100
      - name: var-lib-kubelet
        sizeGiB: 100
      - name: var-lib-etcd
        sizeGiB: 20
    persistent:
      - name: var-cpaas
        sizeGiB: 100
    rawDisks: [] 
    # rawDisks:
    #   - name: data-001
    #     sizeGiB: 50
    # hcs:
    #   type: SSD
  hosts:
    - hostname: <cp-0-hostname>
      ip: <cp-0-ip>
      additionalIps: []
    - hostname: <cp-1-hostname>
      ip: <cp-1-ip>
      additionalIps: []
    - hostname: <cp-2-hostname>
      ip: <cp-2-ip>
      additionalIps: []

computes:
  - name: worker
    replicas: 3
    deployMode: normal
    # hcs:
    #   flavorName: <flavor-name>
    #   availabilityZone: <az>
    #   subnetName: <subnet-name>
    #   rootDisk:
    #     type: SSD
    #     sizeGiB: <root-disk-gib>
    network:
      additions: []
      # additions:
      #   - hcs:
      #       subnetName: <additional-subnet>
    disks:
      ephemeral:
        - name: var-lib-containerd
          sizeGiB: 100
        - name: var-lib-kubelet
          sizeGiB: 100
      persistent:
        - name: var-cpaas
          sizeGiB: 100
      rawDisks: []
      # rawDisks:
      #   - name: data-001
      #     sizeGiB: 50
      # hcs:
      #   type: SSD
    hosts:
      - hostname: <worker-0-hostname>
        ip: <worker-0-ip>
        additionalIps: []
      - hostname: <worker-1-hostname>
        ip: <worker-1-ip>
        additionalIps: []
      - hostname: <worker-2-hostname>
        ip: <worker-2-ip>
        additionalIps: []
#FieldDescription
provider.hcsRequired · objectThe Huawei Cloud Stack settings.
1provider.hcs.credentialRequired · objectThe HCS API credential, written inline. It is rendered into the global-credential Secret. credentialRef is rejected. Required: accessKey, secretKey, projectID, region, and externalGlobalDomain (the HCS external domain without a scheme). schema: https (the default) or http.
2provider.hcs.imageNameRequired · stringThe Alauda OS image that you uploaded to HCS. Every node is created from it. Its Alauda OS version matches the platform version. See Version Mapping.
3provider.hcs.flavorNameConditional · stringThe default ECS flavor, by its API name. Required unless every node group sets hcs.flavorName. The flavor sets the CPU and memory. cpuCore and memoryGiB are therefore rejected on every node group.
4provider.hcs.availabilityZoneOptional · string · Default: the first available zone that HCS reportsThe default availability zone. A node group can override it. See Availability Zone Placement.
5provider.hcs.networkRequired · objectThe node network. vpcName and securityGroupName apply to every node, and a node group cannot change them. subnetName is the default subnet of the primary NIC, an existing subnet of the VPC; a node group can override it. Every subnet named in the file must be in this VPC. ac collects all of them into the HCSCluster.
6provider.hcs.elbRequired · objectThe control plane ELB, which the provider creates. vipAddress: the control plane VIP, an IPv4 address in the VIP subnet. For disaster recovery, see Create a Global Cluster Disaster Recovery Pair. vipSubnetName: optional, default network.subnetName. l4.ips and l7.ips: the L4 and L7 Hybrid Load Balancing addresses. Each takes exactly two distinct IPv4 addresses. Their optional subnetName defaults to network.subnetName.
7provider.hcs.rootDiskConditional · objectThe system disk of all nodes. Required unless every node group sets hcs.rootDisk. type: the EVS type, one of SSD, SAS, or SATA. type defaults to SSD. sizeGiB: required, and greater than 0.
8provider.hcs.diskTypeOptional · string · Default: SSDThe EVS type of the data and persistent disks: SSD, SAS, or SATA. disks.hcs.type overrides it for one node group.
9provider.hcs.controlPlaneHAOptional · object · Default: enabled, soft-anti-affinityThe server group policy of the control plane instances. enabled: default true, which spreads the control plane across physical hosts. false lets HCS place the control plane freely. policy: soft-anti-affinity (the default) or anti-affinity. See Control Plane HA Placement.
controlPlaneRequired · objectThe control plane node group.
10controlPlane.hcsOptional · object · Default: the values of provider.hcsFor this group, overrides flavorName, availabilityZone, and rootDisk of provider.hcs, and subnetName of provider.hcs.network. Uncomment the block and keep only the fields that differ. Set both type and sizeGiB in a group's rootDisk, because it replaces provider.hcs.rootDisk. See Place Node Groups Separately.
11controlPlane.networkOptional · object · Default: no additional NICsTakes only additions: optional additional NICs, matched in order to hosts[].additionalIps. Use the commented block. gateway, dns, and mask are rejected, also on an addition, because the subnet supplies them. See Add a Second NIC.
12controlPlane.network.additions[].hcsOptional · object · Default: the node group's subnetsubnetName: the subnet of the additional NIC.
13controlPlane.disks.ephemeralRequired · []objectvar-lib-containerd, var-lib-kubelet, and var-lib-etcd. They are recreated with the instance. Keep the names, and change only sizeGiB.
14controlPlane.disks.persistentRequired · []objectvar-cpaas. It is kept when the instance is replaced. Keep the name, and change only sizeGiB.
15controlPlane.disks.rawDisksOptional · []object · Default: []Raw block volumes for TopoLVM. Give each one a name of your choice and a sizeGiB from 10 to 32768. Use the commented block. Add any extra volumes here, because other disk names are rejected. See Add Raw Disks.
16controlPlane.disks.hcsOptional · object · Default: the value of provider.hcs.diskTypetype: overrides provider.hcs.diskType for this group.
17controlPlane.hostsRequired · []objectOne entry per node, and at least replicas entries. Each entry sets hostname, ip (the IPv4 address of the primary NIC), and additionalIps (one IPv4 address for each network.additions entry, in order; default []).
computes[]Optional · []object · Default: []The worker node groups, one entry per group. The controlPlane fields above also apply to each entry. The rows below describe the fields whose rules differ for worker node groups.
18computes[].disks.ephemeralRequired · []objectThe list has no var-lib-etcd. Keep var-lib-containerd and var-lib-kubelet, and change only sizeGiB.

cluster.network.loadBalancer is rejected, because the control plane endpoint is the ELB under provider.hcs.elb.

2. Create the Cluster

On the bootstrap node:

<extract-dir>/res/<arch>/ac adm alpha global create --dir <install-dir> --provider hcs

ac first checks that the IAM endpoint <schema>://iam-apigateway-proxy.<externalGlobalDomain> answers. If the check fails, nothing is changed, and the error names the endpoint.

Before you run create, make sure that the credential is correct, and that the names of the image, flavor, availability zone, VPC, subnet, and security group are correct. A wrong credential or name stops the installation in stage 4.

create returns when the installation is complete. If create stops, run the same command again. It skips the work that is already complete. See The create Command.

Once the HCSCluster exists, create does not change its subnet list (spec.network.subnets). A subnet that you add to or change in install-config.yaml after that has no effect.

3. Monitor the Installation

From another terminal on the bootstrap node:

<extract-dir>/res/<arch>/ac adm alpha global status

For the stages and common failures, see Troubleshooting. For Huawei Cloud Stack failures, see Troubleshooting on Huawei Cloud Stack.

Verification

When create returns, the installation is complete, but some platform components can take a few more minutes to become ready. Before you judge the result, wait for them as described in Additional Checks for Alauda OS. Then verify the platform as described in Validation, including its checks for Alauda OS.

Next Steps