Cramps can be brought on by sudden changes in temperature, poor circulation to the affected muscle (such as the calf in intermittent claudication) or a muscle overworking (due to excessively vigorous exercise or when compensating for a stiff joint, for example).
Try some magnesium as this helps relax muscles and keep calcium-rich foods such as dairy and salty foods to a minimum for a while.
Knees are difficult to rest since they carry most of you. Some people try Glucosamine but you have to be very patient indeed to feel an effect (often 3-6 months).
If your painful knee is due to an arthritic condition (and it could be any of the big 3 - gout, rheumatoid arthritis or wear & tear), you can control the symptoms with Arnica gel or Devils Claw but it may be work trying to strengthen the knee for the long term with a collagen supplement (powders are better value).
Hope one of these helps you speedily