Can a single node runs a cluster consisting of 3 master nodes and multiple worker nodes?

Hi I am new to k8s. can a single physical server be setup to run a k8s cluster consisting of 3x master nodes & 2x worker nodes? I am thinking of using Red Hat RHEL to virtualize or containerize them. This is just to test out one of my customer’s use cases. Thanks.

If the hardware is enough there should be no problem to create 5 vms and install them with 3 masters and 2 worker nodes