  On a K\"ahler manifold we consider the problems of maximizing/minimizing
Monge--Amp\`ere energy over certain subsets of the space of K\"ahler
potentials. Under suitable assumptions we prove that solutions to these
variational problems exist, are unique, and have a simple characterization. We
then use the extremals to construct hermitian metrics on holomorphic vector
bundles, and investigate their curvature.
