You're both asking for a simple answer to a possibly complex question. Knee doesn't operate independently and so can be affected by stiffness in key muscles like quads, calves, hamstrings or ITB band - this would fit with pain easing as the affected muscle warms up. Suitable stretches before you run might be all you need. However to identify which stretches/exercises to do and where the problem lies would go to a state registered physiotherapist for advice (not a doctor). Physios are the mobility experts. If you asked me to guess, suggest you look at quad stretches as if stiff quad will pull on kneecap until muscle warms up. There are variants (seated leg raises/extensions) that you can do while sitting as well.