The genocide was commited against the Herero and Nama.
One reason is that the extermination was not ordered by the German government, but rather conducted more or less independently by Lothar von Trothar. The original goal was to simply suppress the uprising. But as the former general failed, they put von Trotha in place who had already successfully lead forces in German East-Africa.
Samuel Maharero managed to lead a fairly successful guerilla war against the Germans. Consequently, von Trotha felt his reputation damaged by not being able to catch Maharero and his people. As von Trotha's anger increased, his strategies became more radical, resulting in the planned genocide after the battle at the Waterberg. Not all of von Throta's men agreed with his decision to shoot at Africans to keep them from the fresh water wells, though most of them followed the orders.
Once the news reached Germany, Bismarck and colonial officers disapproved with von Throta's actions. Wilhelm II. Approved them (surprise).
Source: Zimmerer, Jürgen: Völkermord in Deutsch-Südwestafrika: Der Kolonialkrieg (1904-1908) in Namibia und seine Folgen. 2003.