Pep Guardiola will leave Manchester City after Sunday's final match, ending a remarkable 10-year reign.