Skip to content

Latest commit

 

History

History
103 lines (70 loc) · 3.39 KB

04.ha.md

File metadata and controls

103 lines (70 loc) · 3.39 KB

Deploy by Multi-node and Database

You can use VelaD to build KubeVela control plane with higher availability. It consists of:

  1. More than two nodes as server nodes.
  2. One database (Could be MySQL/MariaDB, PostgreSQL, etcd)
  3. One linux node as load balancer. (Or you can use a cloud load balancer)

arch

We only need run several commands on different nodes.

Setup server nodes

First node

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.

Other nodes

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.

Setup load balancer

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>

Option1: Use another node as load balancer

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.

Option2: Use cloud load balancer

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

Access cluster

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.