Create the global Cluster on Huawei DCS

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 DCS 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
    loadBalancer:
      type: external
      address: <control-plane-endpoint>
      port: 6443
      # vrid: <vrid>
      # interface: <nic-name>

provider:
  dcs:
    credential:
      endpoint: https://<fc-address>:7443
      authUser: <user>
      authKey: <password>
      site: <site-id>
      userType: interconnect
    vmTemplateName: <vm-template-name>
    controlPlaneHA: <control-plane-ha>
    machineFolder: <folder-name>
    # cdRomDatastoreName: <datastore>
    # osType: alaudaos-k
    # rootDisk:
    #   sizeGiB: <root-disk-gib>
    network:
      dvSwitchName: <dv-switch-name>
      portGroupName: <port-group-name>
    disks:
      datastore:
        type: <datastore-type>
        name: <datastore-name>
      isThin: false
      pciType: VIRTIO

controlPlane:
  replicas: 3
  cpuCore: 8
  memoryGiB: 16
  deployMode: normal
  # dcs:
  #   machineFolder: <folder-name>
  #   cdRomDatastoreName: <datastore>
  #   rootDisk:
  #     sizeGiB: <root-disk-gib>
  network:
    gateway: <cp-gateway>
    # dns: [<dns-ip>]
    mask: <prefix-length>
    additions: []
    # additions:
    #   - mask: <prefix-length>
    #     dcs:
    #       dvSwitchName: <dv-switch-name>
    #       portGroupName: <port-group-name>
  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
    # dcs:
    #   datastore:
    #     type: <datastore-type>
    #     name: <datastore-name>
    #   isThin: true
    #   pciType: VIRTIO
  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
    cpuCore: 8
    memoryGiB: 16
    deployMode: normal
    # dcs:
    #   machineFolder: <folder-name>
    #   cdRomDatastoreName: <datastore>
    #   rootDisk:
    #     sizeGiB: <root-disk-gib>
    network:
      gateway: <worker-gateway>
      # dns: [<dns-ip>]
      mask: <prefix-length>
      additions: []
      # additions:
      #   - mask: <prefix-length>
      #     dcs:
      #       dvSwitchName: <dv-switch-name>
      #       portGroupName: <port-group-name>
    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
      # dcs:
      #   datastore:
      #     type: <datastore-type>
      #     name: <datastore-name>
      #   isThin: true
      #   pciType: VIRTIO
    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
cluster.networkRequired · objectThe cluster network.
1cluster.network.loadBalancerRequired · objecttype: external, the default, uses your own load balancer, which must be ready before create. internal uses a Self-built VIP that the provider runs on the control plane nodes. address: the load balancer address or the VIP. It must be an IPv4 address that is not a node address and is outside the Pod, Service, and join CIDRs. port: default 6443. With internal, uncomment vrid: a required VRRP router ID from 1 to 255 that is unique in the control plane Layer 2 domain. You can also uncomment interface: the NIC that holds the VIP. By default, this is the NIC of the node IP. vipMode is not supported. See Control Plane Endpoint and HA.
provider.dcsRequired · objectThe Huawei DCS settings.
2provider.dcs.credentialRequired · objectWritten inline and rendered into the global-credential Secret. credentialRef is rejected. endpoint: the FusionCompute address, https://<host>:<port>, without a trailing slash. authUser and authKey: the user and the plain-text password, not the SHA-256 digest that the DCS console shows. site: the bare site ID. The urn:sites: form is rejected. userType: interconnect (the default) or domain. For the DCS-side requirements, see DCS Credential Secret.
3provider.dcs.vmTemplateNameRequired · stringThe VM template that every node is cloned from. Its Alauda OS version matches the platform version. See Version Mapping.
4provider.dcs.controlPlaneHARequired · booleanControl plane spread. true spreads the control plane VMs across DCS hosts with a DRS rule. For its requirements, see Control Plane Spread. false places the VMs without that rule.
5provider.dcs.machineFolderRequired · stringThe name of an existing VM folder on DCS, in which the node VMs are created. Use a VM folder, not a cluster or storage folder. Enter the folder name only, not a path; it must match exactly. ac does not create the folder.
6provider.dcs.cdRomDatastoreNameOptional · string · Default: the datastore of the system diskThe datastore of the CD-ROM that carries each node's Ignition ISO.
7provider.dcs.osTypeOptional · string · Default: Alauda OS M55The template OS that you noted in Prerequisites. Set alaudaos-k for a template of Alauda OS KO or KU. See OS Variants. For any other template, leave it out.
8provider.dcs.rootDiskOptional · object · Default: the VM template's system disk sizesizeGiB: the system disk size. DCS rejects a size smaller than the template's.
9provider.dcs.networkRequired · objectThe primary NIC: dvSwitchName and a portGroupName on that switch.
10provider.dcs.disks.datastoreConditional · objectWhere every disk of the node is created. type: Datastore for a single datastore, or DatastoreCluster for a datastore cluster. name: the name of the datastore or datastore cluster. Required unless every node group sets disks.dcs.datastore. See Disks.
11provider.dcs.disks.isThinOptional · boolean · Default: falsetrue thin-provisions the persistent and raw disks. false thick-provisions them. The ephemeral disks are not affected.
12provider.dcs.disks.pciTypeOptional · string · Default: VIRTIOThe bus of the persistent and raw disks: VIRTIO, SCSI, or IDE.
controlPlaneRequired · objectThe control plane node group.
13controlPlane.dcsOptional · object · Default: the values of provider.dcsFor this group, overrides machineFolder, cdRomDatastoreName, and rootDisk of provider.dcs. The same rules apply. Uncomment the block and keep only the fields that differ.
14controlPlane.networkRequired · objectThe NICs of the node. gateway: the IPv4 gateway of the primary NIC. mask: its prefix length, 1 to 32. dns: optional. DCS uses only the first entry. additions: optional additional NICs, matched in order to hosts[].additionalIps. additions defaults to []. Use the commented block. In each addition, mask is 1 to 32 and defaults to network.mask. See Additional NICs.
15controlPlane.network.additions[].dcsOptional · object · Default: the values of provider.dcs.networkThe switch and port group of the additional NIC: dvSwitchName and portGroupName.
16controlPlane.disks.ephemeralRequired · []objectvar-lib-containerd, var-lib-kubelet, and var-lib-etcd. They are recreated with the VM. Keep the names, and change only sizeGiB.
17controlPlane.disks.persistentRequired · []objectvar-cpaas. It is kept when the VM is replaced. Keep the name, and change only sizeGiB.
18controlPlane.disks.rawDisksOptional · []object · Default: []Raw block volumes for TopoLVM. Give each one a name of your choice and a sizeGiB greater than 0. Use the commented block. See Raw Disks for TopoLVM.
19controlPlane.disks.dcsOptional · object · Default: the values of provider.dcs.disksFor this group, overrides datastore, isThin, and pciType of provider.dcs.disks. Uncomment the block and keep only the fields that differ. If you override the datastore, set both of its fields.
20controlPlane.hostsRequired · []objectOne entry per node, and at least replicas entries, because DCS does not assign node identities. 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 numbered lines of the worker entry.
21computes[].dcsOptional · object · Default: the values of provider.dcsThe same as controlPlane.dcs.
22computes[].disks.ephemeralRequired · []objectThe list has no var-lib-etcd. Keep var-lib-containerd and var-lib-kubelet, and change only sizeGiB.

2. Create the Cluster

On the bootstrap node:

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

ac first checks the DCS sign-in, the DCS objects named in install-config.yaml, and the registry. If a check fails, nothing is changed, and the error names the item that failed. Make sure that an external load balancer is ready before you run create.

WARNING

Before you run create, make sure that the password in install-config.yaml is correct. DCS locks the account after repeated failed sign-ins.

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.

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 DCS failures, see Troubleshooting on Huawei DCS.

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.

Applies to: a Self-built VIP (cluster.network.loadBalancer.type: internal). Skip this check with an external load balancer.

Log in to a control plane node of the global cluster as the boot user (ssh boot@<control-plane-node-ip>). Use the private key that matches an SSH public key in cluster.sshKeys. Run curl with sudo, because only root can read the cluster CA file:

sudo curl --cacert /etc/kubernetes/pki/ca.crt https://<control-plane-vip>:6443/healthz

Continue when it prints ok. Otherwise, see Troubleshooting on Huawei DCS.

Next Steps