Configure the route admission policy

By default, MicroShift allows routes in multiple namespaces to use the same hostname. To prevent routes from claiming the same hostname in different namespaces, you can configure the route admission policy.

Prerequisites
  • You installed MicroShift.

  • You created a MicroShift config.yaml file.

  • You installed the OpenShift CLI (oc).

    Tip

    If you complete all the configurations that you need to make in the MicroShift config.yaml file at the same time, you can minimize system restarts.

Procedure
  1. To prevent routes in different namespaces from claiming the same hostname, update the namespaceOwnership field value to Strict in the MicroShift config.yaml file. See the following example:

    Example config.yaml route admission policy
    # ...
    ingress:
      routeAdmissionPolicy:
        namespaceOwnership: Strict
    # ...

    where:

    ingress.routeAdmissionPolicy.namespaceOwnership

    Specifies the route admission policy. Prevents routes in different namespaces from claiming the same host. Valid values are Strict and InterNamespaceAllowed. If you delete the value in a customized config.yaml, the InterNamespaceAllowed value is set automatically.

  2. To apply the configuration, restart the MicroShift service by running the following command:

    $ sudo systemctl restart microshift