From what I gather, Camino Portuguese (starting from Porto) [~248km] is a wonderful route. This allows you to walk comfortably without stressing about losing days to travel/flights, and accommodates for a few rest days if your knees flare up.
It is more of a rural setting but you are walking along the coast then through dense forests as you near SdC.
If you are committed to doing
Camino Frances route, skip Villafranca to O'Cebreiro (killer up hill) and from O'Cebreiro to Triacastela (rough down hill).
That being said, I'm not sure how many people walk Camino Portuguese in June/July. Friends who walked during August/September found the route to be quite empty, which they enjoyed.
Camino Frances, on the other hand, the last 100km is going to be quite interesting.
You can always mix it up a bit and do a bit of the Camino Portuguese and switch to
Camino Frances (Starting at Sarria) for the last 100km to be eligible for the compostela at SdC.
Buen Camino, Peregrino!
P.S. The pharmacies should sell Ibuprofen and Diclofenac for your knee, provided it is inflammation related and not a severe injury or mechanical issue.