how to restrict access in routing.yml based on roles
This should work

requirements:
  _role: 'administrator'


See more details here https://www.drupal.org/docs/8/api/routing-system/structure-of-routes