I have been creating a network lab in packet tracer for practice. I have 3 vlans in subnet A and I am trying to configure router on a stick at gig6/0 on the bottom left of the image. Do I need to create a subnet for each VLAN in order for the router on a stick gateway to work?
I'm not understanding your exact problem because you don't provide enough detail but maybe this helps:
With rare exceptions, an IP subnet is mapped to a VLAN = broadcast domain = layer-2 network on a 1:1 basis.
You can run multiple IP subnets inside a single VLAN but they need a router to communicate with each other. Most often this setup doesn't make too much sense.
You can't run a single IP subnet across multiple VLANs though (without elaborate workarounds). Nodes in the same subnet expect to be able to talk to each other on a common layer-2 network = VLAN = broadcast domain.
So, your "VLANs within a subnet" can only work when you've split that subnet into sub-subnets properly and set up the router as gateway in between. A router on a stick is a router forwarding between VLAN subinterfaces on a single physical interface. Each subinterface needs to connect to one of the desired VLANs, so the link needs to be a VLAN trunk on both the switch and the router side.
Just to amplify on Zac’s answer: you have one subnet per vlan and vice versa. At the CCNA level, you can ignore the rare exceptions. The router on a stick has an (sub)interface in each subnet. Therefore all VLANs must be trunked to the router.
In practice, it is always a good idea to have VLAN with its own subnet. However, you can split a subnet into multiple VLANs since it is only a test topology and you don't have to worry about the IP address management challenges.