  We generalize to topologically non-trivial gauge configurations the
description of the Einstein-Yang-Mills system in terms of a noncommutative
manifold, as was done previously by Chamseddine and Connes. Starting with an
algebra bundle and a connection thereon, we obtain a spectral triple, a
construction that can be related to the internal Kasparov product in unbounded
KK-theory. In the case that the algebra bundle is an endomorphism bundle, we
construct a PSU(N)-principal bundle for which it is an associated bundle. The
so-called internal fluctuations of the spectral triple are parametrized by
connections on this principal bundle and the spectral action gives the
Yang-Mills action for these gauge fields, minimally coupled to gravity.
Finally, we formulate a definition for a topological spectral action.
