You asked

Which lens should I pair with a pentax k 5 ii for portraits on a limited budget?

For portraits on the Pentax K-5 II, look at fast primes in the 50 to 70mm range. The body has a 1.5 crop factor, so a 50mm lens frames like 75mm on full frame, which is a classic portrait length. The Pentax K-5 II also stabilises in the body, which steadies the camera for slower shutter speeds. It does not steady your subject, so a wide aperture still does most of the work for portraits.

The guide's sensor page says a good APS-C camera with good lenses is enough for most portraits, so there's no need to switch systems. Three lenses from the K-5 II's catalogue fit well:

The guide's catalogue pages I can see don't list prices, and none of these lenses is labelled cheap there, so I can't confirm which fits your budget. Check the price section on each lens page for current figures. If you want a lens that also works for wider environmental shots, the Pentax HD DA 40mm f/2.8 Limited is a more general option, though it's slower.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.