Extremal eigenvalue problems with indefinite kernels