You can use VelaD to build KubeVela control plane with higher availability. It consists of:
- More than two nodes as server nodes.
- One database (Could be MySQL/MariaDB, PostgreSQL, etcd)
- One linux node as load balancer. (Or you can use a cloud load balancer)
We only need run several commands on different nodes.
On the first server node, run
velad install --bind-ip=<LB_IP> --database-endpoint=<DB_ENNDPOINT> --token=<TOKEN> --node-ip=<IP>
<LB_IP>
is IP of load balancer node. We'll setup it later. Passing it to bind-ip
helps VelaD generate right
kubeconfig.
<TOKEN>
is optional. Token will be generated if you don't use this argument. VelaD will print generated or given token
after install.
<IP>
is optional. If the node have a public IP, you can pass it to node-ip
.
<DB_ENDPOINT>
is the database connection string. The format is here.
You need to setup database before and make sure all your server nodes can access it.
On the other node, you need to run velad install
with the same arguments and one more: --cluster-only
.
--cluster-only
means skip install KubeVela and only start node. These nodes belong to one cluster and don't install
KubeVela repeatedly.
velad install --bind-ip=<LB_IP> --database-endpoint=<DB_ENNDPOINT>\
--token=<TOKEN> \
--cluster-only
--node-ip=<IP>
<TOKEN>
should be the same with that in first node.
--node-ip=<IP>
is optional. If the node have a public IP, you can pass it to node-ip
.
On any master node, run
velad load-balancer wizard
It will show you the command to install nginx and setup it for forwarding the network traffic to master nodes. For example:
To setup load-balancer, run the following command on node acts as load-balancer:
velad load-balancer install --http-port 32196 --https-port 30297 --host=<IP1>,<IP2>
Paste the command to the load balancer node and run it.
velad load-balancer install --http-port 32196 --https-port 30297 --host=<IP1>,<IP2>
<IPx>
is IPs of server nodes. It can be public IP or private IP. As long as the load balancer node can access it.
This will call package manager of system to install nginx and setup it for forwarding the network traffic to server nodes.
If you prefer to use cloud load balancer, you can configure it to forward the network traffic to server nodes. For
example you can configure the port-forwarding of Alibaba Cloud SLB like this. The 6443
is required to access the
cluster. The 80
and 443
are optional. You can pick other ports or don't forward them. They help to access the
Ingress in the cluster. The 32196
and 30297
are the ports printed by velad load-balancer wizard
. It's decided
when velad install
is called and can be different in different clusters.
6443 -> 6443
80 -> 32196
443 -> 30297
Run command below on any server nodes. Copy the file to any computer which can access the load balancer.
velad kubeconfig --external
Boom! You can access the KubeVela control plane with this kubeconfig. Failure of any single server won't affect the availability of the control plane.