Karnataka CM resigns