The knees are engaged during almost all yoga postures. (Info from Prevent Yoga Injury.com)
Two main issues for knee pain or discomfort:

Table Pose
1) Discomfort or pain when direct pressure of body weight is placed on the knee joints and patella as in Table Pose, Camel, Cat, and Cow Poses to name a few. For this type of knee issue, simply and cushioning under the knees for support. This can be a blanket or a fold in your yoga mat, etc.

Low Lunge
2) Discomfort or pain when the joint is taken beyond a comfortable range of motion. Some examples may include: Full lotus, Child’s Pose, Pigeon, Low Lunge, Hero pose .
The good news is that just about every asana can be modified to accommodate a knee injury, pain or discomfort with a few simple props that are commonly available in studios. Students may have to try several different modifications before finding the one that provides comfort, so trial and error is in order.
Yoga blankets, blocks and bolsters are standard props in studios. If you experience discomfort when applying direct pressure modify by simply folding the blanket and placing under the knee to provide additional cushion. If extreme flexion of the knee causes pain or discomfort (think Child’s or Hero) then you can sit up on the block or bolster or roll the blanket up and place it between your lower calf and thigh close to your bottom to reduce the bend in the knee. You don’t need a “yoga” blanket or bolster necessarily, if you have a home practice, any thick throw blanket or extra firm pillow will do.
Remember, even when you go to a yoga class at a studio or gym, it’s your practice. The teacher and the students around you can’t feel what’s going on in your body, only you can, so listen to it and respond accordingly. Never feel embarrassed or judged for using a prop or an aid or skipping an asana altogether, if that’s what you need to do. At the end of the day, you are responsible for your own yoga safety. Take care of yourself.
If you’ve ever experienced knee pain—or, worse luck, a chronic knee problem—you know how frustrating and limiting it can be. Unfortunately, it’s not unusual for yoga students to practice asanas with small misalignments in the knee. Repeated over months and years, these small misalignments can contribute to pain and long-term joint problems. On the other hand, yoga poses practiced with conscious good alignment of the leg bones and joints can be a wonderful tool for building strong, healthy knees.