Abstract: The deconfinement transition in gauge theories, in which the Polyakov loop acquires a non-zero expectation value, is described in AdS/CFT as the formation of a black hole in the dual graviational theory. We will explain how to compute the free energy diagram for the Polyakov loop by a constrained gravitational path integral, leading to a new class of black hole solutions.