KASCADE and KASCADE-Grande were multi-detector installations to measure individual air showers of cosmic rays at ultra-high energy . Based on data sets measured by KASCADE and KASCADE-Grande , 90 % C.L . upper limits to the flux of \gamma rays in the primary cosmic ray flux are determined in an energy range of 10 ^ { 14 } -10 ^ { 18 } eV . The analysis is performed by selecting air showers with a low muon content as expected for gamma-ray induced showers compared to air showers induced by energetic nuclei . The best upper limit of the fraction of \gamma rays to the total cosmic ray flux is obtained at 3.7 \times 10 ^ { 15 } eV with 1.1 \times 10 ^ { -5 } . Translated in an absolute \gamma -ray flux this sets constrains on some fundamental astrophysical models , such as the distance of sources for at least one of the IceCube neutrino excess models .