Assuming these cramps are diet related, you could consider eating some whole raw vegetables that have high magnesium.
Athletes especially, are known to get magnesium deficiency, and a symptom is muscle cramping. When you exercise you deplete your magnesium reserves.
I can't say for sure that eating foods with magnesium will help with your muscle cramping, but that is the first approach I would most likely take for myself.
Some foods high in magnesium are: spinach, swiss chard, dandelion greens, pumpkin seeds, and sunflower seeds. There are others, those are just some examples.
Hydration is also very important. When I exercise and am dehydrated I start cramping all over the place.