@Jagielag first I highly recommend you read the thread on how @Jonathan dealt with his knee issues. Most of what he recommends have been good for me.
Second, I have a similar issue whereby knee instability / pain / weakness manifests in hip asymmetry / imbalance. I’m still battling through it but here’s a bit of my story.
I ride almost exclusively indoors and use a homemade rocker plate. I neglected to change / rotate the springs regularly and didn’t notice that the left side started to compress such that I was riding with the bike at a slight angle (on average). Over time this manifested in pain in the outside of my left knee and right hip / gluteus medius muscle. At its worst I had a noticeable curvature to my spine when standing upright because of the twist in my hips. This also presented while on the bike and was noticed by my bike fitter.
First remedy was to replace the rocker plate springs and rotate / change them regularly. I’ve set a monthly email / calendar reminder, and have become much more conscious of the uprightness while riding indoors. I’m fortunate enough to have power meter pedals and monitor my left / right balance after every ride. I’m usually 52% / 48% split right / left but notice it getting worse when fatigued.
As mentioned above I also got a bike fit. Part of the problem at the time was my bike was one size too big. We did some unnatural acts to get it to work but I eventually got a properly sized bike. Using the previous bike fit as well as an independent assessment using the Retul system, I used MyVeloFit (great thread here) to dial in my fit.
Next (and ongoing) focus was to strengthen my left leg through single leg exercises. This was easier during the offseason when the focus was on lifting and I need to get back to it. I also incorporated hip and glute exercises (e.g. banded monster walks, etc) into my gym routines.
The glute med pain is actually due to fatigue and overuse as it compensates for the left knee pain and weakness. Before each ride I warm up with single leg raises while on my back and side, and use a lacrosse ball to release the glute med - just put it against a wall and really lean into it. It can be painful but feels oh so good when done.
Hope this helps a little. Happy to answer any questions you may have.