Changing subdomain of a microserviceΒΆ

A microservice can be contacted externally (i.e. from outside a cluster) on a subdomain which is configurable. The subdomain of a microservice is generally the same as the name of the microservice but it can be changed.

To change the subdomain on which a microservice is exposed you need to modify the conf/routes.yaml file in the project directory.

A typical routing config block looks as follows:

myapp:  # the subdomain
  /:
    corsPolicy: allow_all
    upstreamService:
      name: myapp  #  the microservice name
      namespace: '{{ cluster.metadata.namespaces.user }}'
    upstreamServicePath: /
    upstreamServicePort: 80

To serve the microservice <myapp> at the subdomain <newsubdom>, update the config block as follows:

   newsubdom:  # the new subdomain
     /:
       corsPolicy: allow_all
       upstreamService:
         name: myapp  #  the microservice name
         namespace: '{{ cluster.metadata.namespaces.user }}'
       upstreamServicePath: /
       upstreamServicePort: 80

To apply the changes, commit conf/routes.yaml and git push hasura master to deploy the changes.