Alibaba Cloud
SHC has a connection type for Alibaba Cloud. One AccessKey pair gives a cluster running on ECS instances DNS, a network load balancer and disks.
A Terraform module builds the machines and bootstraps the cluster:
terraform/modules/shc/alibaba, with
the example root
terraform/examples/alibaba-shc and
the smoke lane make test/alibaba. All three have never been applied to a
real account. They stop at the machines and the bootstrap: they do not create
the alibaba connection and do not record a node’s cloud and location, so do
both as this page says. The module names each ECS instance after its node,
which is what the disks need.
This page states what the code does. No live estate has run on Alibaba Cloud yet, so it has no list of gotchas.
At a glance
Section titled “At a glance”| Concern | Value |
|---|---|
| Connection type | alibaba |
| Required credentials | access_key_id, access_key_secret, region |
| DNS | alibaba: the account’s Alibaba Cloud DNS domains |
| Load balancer | alibaba-nlb: one network load balancer per connection, TCP and UDP |
| Block volumes | alibaba-disk: ESSD disks created in one zone |
| Node cloud | alibaba, set by hand. Alibaba Cloud nodes are not detected |
| Node location | The zone id, for example cn-hangzhou-h, set by hand |
Credentials
Section titled “Credentials”| Field | Used by | Secret | Meaning |
|---|---|---|---|
access_key_id | all | yes | The AccessKey ID |
access_key_secret | all | yes | The AccessKey secret |
region | all | no | The region id, for example cn-hangzhou |
zone_id | volumes | no | The zone new disks are created in, for example cn-hangzhou-h |
vpc_id | load balancer | no | An existing VPC the load balancer is created in |
zone_mappings | load balancer | no | A JSON array naming one existing vSwitch per zone: [{"ZoneId":"...","VSwitchId":"..."}], each zone once |
The first three are required to connect. zone_id is required only for
volumes: without it a volume is refused with X400325VOLCFG. vpc_id and
zone_mappings are required only by the load balancer: without them a port
published through the connection is refused with X400973PRXCFG.
Connect
Section titled “Connect”A secret never goes on the command line. Both halves of the AccessKey are secrets, so they go in one JSON file read from standard input:
{"access_key_id": "<AccessKey ID>", "access_key_secret": "<AccessKey secret>"}$ shc connection connect alibaba --cred region=cn-hangzhou --cred zone_id=cn-hangzhou-h --cred vpc_id=vpc-bp1aaaa --cred 'zone_mappings=[{"ZoneId":"cn-hangzhou-h","VSwitchId":"vsw-bp1aaaa"},{"ZoneId":"cn-hangzhou-i","VSwitchId":"vsw-bp1bbbb"}]' --value-file alibaba.jsonThe load balancer is named shc-<connection name>.
Nodes: cloud and location
Section titled “Nodes: cloud and location”A block volume reaches only the nodes whose recorded cloud and location match
the volume’s. For alibaba-disk that is cloud alibaba and the connection’s
zone_id.
ECS instances are not detected. A node on Alibaba Cloud records no cloud and
no location until you say so, and until then no alibaba-disk reaches it. A
deployment whose volume cannot reach any node stays pending.
The location is the zone id as Alibaba Cloud writes it, for example
cn-hangzhou-h.
Say both when the node is created:
$ shc init --cloud alibaba --location cn-hangzhou-h$ shc node join <token> --cloud alibaba --location cn-hangzhou-hOr on a node that already exists:
$ shc node update <node> --cloud alibaba --location cn-hangzhou-hCheck what each node records:
$ shc node lsThe location column reads alibaba/cn-hangzhou-h.
Volumes
Section titled “Volumes”alibaba-disk creates one ESSD disk per volume in the connection’s zone,
attaches it to the instance that runs the deployment, and moves it with the
deployment.
- A disk is at least 20 GiB. A smaller request gets 20 GiB.
- The provider finds the instance by the node’s name: the one ECS instance
whose instance name equals it. A node name that is an instance id (
i-...) or a private IP address matches on that instead. Name each instance after its node. No match, or more than one, is refused. - The disk and the instance must be in the same zone, or the attach is refused
with
X400325VOLCFG. - An instance type that requires NVMe is refused with
X400325VOLCFG. Use an instance type that attaches disks over virtio. - The disk is not deleted with the instance.
With more than one connection that can provision volumes, name the one to use:
$ shc config set storage.volumes.provider alibabaWhich mounts go on a block volume is covered in Block storage by default.
Load balancer
Section titled “Load balancer”alibaba-nlb keeps one internet-facing network load balancer per connection,
named shc-<connection>, billed pay-as-you-go, in the VPC and vSwitches the
connection names. Every deployment that publishes a port through the
connection shares it, so an outside port binds once per connection.
Publish a port through it by naming the connection after @:
$ shc install <app> -t <tenant> -s <stack> --expose 5432@alibaba=<service>:5432It forwards TCP and UDP.
The alibaba DNS provider writes records in the account’s Alibaba Cloud DNS
domains. Name the zones the connection manages with --zone when you connect.