Kroger, the largest U.S. grocery-store chain, has agreed to buy Harris Teeter Supermarkets for $2.5 billion in cash to bolster its presence in the southeastern part of the country.