Building a three-node cluster
A single appliance is a single point of failure. If its host dies, or you patch it, every workflow stops. A cluster of three appliances behind a load balancer keeps Orchestrator running when any one node is down, and picks up the interrupted workflows on the nodes that are left. This recipe turns the appliance from chapter 1 into the first node of such a cluster.
Getting ready
You need:
- The first node,
vco01.vmw.lab, deployed and authenticated as in chapter 1. This becomes the cluster’s primary node. - Two more appliances,
vco02.vmw.labandvco03.vmw.lab, deployed as in recipe 1.2 from the same OVA build, with the same Kubernetes network ranges. Don’t configure authentication on them. Joining wipes them anyway. - A load balancer with a virtual IP and the FQDN
vco.vmw.lab. NSX, HAProxy, F5, or anything else that can forward TCP will do. You set it up in step 1. - DNS: an A record and a PTR record for all four names (the three nodes and the load balancer), created before you start. Both are mandatory, as for a single appliance (recipe 1.2).
- A certificate whose SANs include
vco.vmw.lab,vco01.vmw.lab,vco02.vmw.lab, andvco03.vmw.lab. Create the CSR as in recipe 2.2, with all four names in-addext. - SSH on all three appliances, and a root shell on each: log in as
vmware-system-userand runsudo su -(recipe 2.1). - A snapshot of each of the three VMs, taken with the VMs running but without memory, just before you start.
- A maintenance window of about an hour.
vco01is offline for most of it.
Check that every pod is running on each appliance before you go further:
kubectl -n prelude get podsHow to do it
-
Set up the load balancer. Create a pool and a virtual server with these settings:
Setting Value Virtual server vco.vmw.lab, TCP port443Type Layer 4 (TCP passthrough). Don’t decrypt TLS on the load balancer. Pool members vco01,vco02,vco03, port443Persistence None Health monitor HTTP GET /healthon port8008, healthy on status200, every 3 seconds, 10-second timeoutOnly
vco01will pass the health check for now. That’s expected. -
Point authentication at the load balancer. On
vco01, check the current provider, then register it again with the load balancer’s name as the address Orchestrator advertises. This example re-registers the vSphere provider from recipe 1.4:
vracli vro authenticationvracli vro authentication unregister -u administrator@vsphere.localvracli vro authentication set -p vsphere \ --hostname https://vc01.vmw.lab \ --username administrator@vsphere.local \ --tenant vsphere.local \ --admin-group OrchestratorAdmins \ --admin-group-domain vsphere.local \ --fqdn vco.vmw.lab- Stop the services on the primary node:
/opt/scripts/deploy.sh --onlyClean- Tell the appliance about the load balancer:
vracli load-balancer set vco.vmw.lab- Load the cluster certificate. Copy the PEM chain to
vco01as in recipe 2.2, then:
vracli certificate ingress --set /root/vco-cluster-chain.pem- Join the second node. On
vco02, run the join command against the primary and entervco01’s password when asked. The join resetsvco02, copies the cluster configuration fromvco01, and takes 10 to 15 minutes:
vracli cluster join vco01.vmw.lab- When the join on
vco02has finished, join the third node the same way, fromvco03:
vracli cluster join vco01.vmw.labroot password in the 8.x procedure. With direct root login over SSH off from 9.1.1 (recipe 2.1), record on a 9.1.1 cluster which account and password vracli cluster join asks for.- Check the cluster. Back on
vco01, all three nodes should be listed andReady:
kubectl -n prelude get nodesSSH session on vco01 showing kubectl -n prelude get nodes with vco01, vco02 and vco03 all in Ready state.
- Deploy the services across the cluster. On
vco01, run the deployment script and wait forPrelude has been deployed successfully. In a second SSH session you can watch the pods start on all three nodes withwatch -n 5 "kubectl -n prelude get pods -o wide".
/opt/scripts/deploy.sh- Check the load balancer. All three pool members should now pass the health check.
The load balancer's pool status page (NSX in the lab) for the vco.vmw.lab pool, with vco01, vco02 and vco03 all up.
- Browse to
https://vco.vmw.laband log in. From now on, use only this name, in browsers, in VCF Automation integrations, and in scripts. - Delete the snapshots once you’re happy with the cluster. Don’t keep them as a fallback (see “There’s more”).
–fqdn) is the right replacement for the old Control Center Host Settings page, and whether 9.x still needs deploy.sh –onlyClean in step 3.GET /health on port 8008, come from the vRealize Automation 8.11 load balancing guide’s entries for external Orchestrator. Confirm the health URL and port on 9.1.1 with curl -k http://vco02.vmw.lab:8008/health, and record what it returns.How it works
vracli cluster join doesn’t link three separate Orchestrators together. It turns three appliances into one Kubernetes cluster that spans all three VMs. The joining node throws away its own setup, fetches the configuration from the primary, and becomes another member of the same cluster. Then deploy.sh spreads the services over the three nodes:
- Orchestrator runs on every node, and all three take requests and run workflows. That’s why the load balancer needs no persistence.
- PostgreSQL runs on every node too. One copy is the primary database, and the other two are replicas kept in step with it asynchronously. If the primary database’s node fails, one of the replicas takes over automatically.
- Workflow state lives in that shared database. If a node fails partway through a workflow, another node picks the run up from the last step that hadn’t finished.
Because everything that matters is in the shared database and the shared cluster configuration, you configure Orchestrator once, through vco.vmw.lab, and every node gets the same settings, plug-ins, content, and certificates.
The cluster survives the loss of one node. With two nodes down, it stops working, because the remaining node can’t tell whether it’s the one that’s cut off.
Setting the load balancer and the advertised FQDN matters because Orchestrator builds links and login redirects from its own name. If it still thought it was vco01, a user who reached it through vco.vmw.lab would be redirected to vco01 after logging in, and would lose the protection of the cluster without noticing.
vracli load-balancer set on the first, vracli cluster join on the others, and deploy.sh. The database is built in and replicated for you.There's more
9.1.2: a load balancer inside the appliance . From 9.1.2, the appliance has an integrated load-balancing service. A three-node cluster can spread traffic with Kubernetes-native routing, so step 1’s external load balancer is no longer required. On 9.1.1 and earlier, keep the external one. Broadcom documents the setup in Configuring VCF Operations Orchestrator Load Balancing.
vco.vmw.lab on an external load balancer, whether step 2 (advertising the load balancer’s name to the authentication provider) still applies, and whether the health check on port 8008 is still needed.Removing a node is a one-way trip. To shrink the cluster, run vracli cluster leave on the node you want to remove, then check from a remaining node with kubectl -n prelude get nodes. A node that has left can’t be joined again. Delete the VM and deploy a new one if you need it back.
Recovering a broken node. If one node is NotReady and won’t recover, remove it from a healthy node, then join it again from the broken node:
vracli cluster remove vco03.vmw.labvracli cluster join vco01.vmw.labJoin it to whichever node holds the primary database, which may no longer be vco01. To find out, run this on a healthy node, then map the pod to its node with kubectl -n prelude get pods -o wide:
kubectl -n prelude exec postgres-0 -- chpst -u postgres repmgr cluster show --terse --compactDon’t revert one node to a snapshot. Restoring a single node from a snapshot puts it out of step with the other two and can break the Kubernetes cluster. If a change goes wrong, revert all three nodes together, while they’re powered off.
Keep the root passwords the same. Each node keeps its own root password. Anything that reaches a node through the load balancer lands on whichever node it’s sent to, so different passwords quickly become confusing. If you need to change one, take that node out of the load balancer pool first, change it, and put the node back.
Two nodes isn’t a cluster. The procedure supports exactly three. With two, losing either node takes the cluster down, which is worse than running one.
Sizing. Every node needs the full 4 vCPUs, 12 GB of memory, and 200 GB of disk from recipe 1.2. If you raise memory for a bigger Java heap (recipe 2.7), do it on all three.
See also
- 2.2 Replacing the appliance certificate, for building the PEM chain.
- 1.4 Authenticating with vSphere, for the full set of authentication options used in step 2.
- Broadcom TechDocs: Configure a VCF Operations Orchestrator Cluster, Removing VCF Operations Orchestrator Cluster Nodes, and Recovering a VCF Operations Orchestrator Cluster Node.
