Geometric frustration emerges when local interaction energies in an ordered lattice structure cannot be simultaneously minimized, resulting in a large number of degenerate states. The numerous degenerate configurations may lead to practical applications in microelectronics 1, such as data storage, memory and logic 2 . However, it is difficult to achieve very high degeneracy, especially in a two-dimensional system 3,4 . Here, we showcase in situ controllable geometric frustration with high degeneracy in a two-dimensional flux-quantum system. We create this in a superconducting thin film placed underneath a reconfigurable artificial-spin-ice structure 5 . The tunable magnetic charges in the artificial-spin-ice strongly interact with the flux quanta in the superconductor, enabling switching between frustrated and crystallized flux quanta states. The different states have measurable effects on the superconducting critical current profile, which can be reconfigured by precise selection of the spin-ice magnetic state through the application of an external magnetic field. We demonstrate the applicability of these effects by realizing a reprogrammable flux quanta diode. The tailoring of the energy landscape of interacting 'particles' using artificial-spin-ices provides a new paradigm for the design of geometric frustration, which could illuminate a path to control new functionalities in other material systems, such as magnetic skyrmions 6, electrons and holes in two-dimensional materials 7,8, and topological insulators 9, as well as colloids in soft materials 10-13 .