When we start with 1 node and then add more nodes later, will rebalance happen automatically.
Yes, rebalancing will happen automatically.
Also, is there restriction on the number of nodes in the cluster.
There is no restriction on the number of nodes in a cluster
For example: Can it got from 1 to 2 to 3 and so on OR does it have to go from 1 to 3 to 5 nodes. If 2 is allowed, how is fault tolerance achieved.
You can scale one by one, we support both an even and odd number of nodes. Generally, we discuss fault tolerance on the replica level. We recommend at minimum a three-node cluster to benefit from CockroachDB’s fault tolerance. 2 is allowed but is not recommended and we require an odd number of replicas in order to achieve quorum. This means that on a 2 node cluster you will have to stay with 1x replication and the loss of one node can lead to an unavailable cluster.
This section should explain what you’re looking for.
A three node cluster will have a 3x replication factor which means you will be able to lose one node and will still be able to serve reads and writes.