Routing Manifest

Routing manifest is needed to make multiple services public on the same domain.

For example, let's assume you have created a front-end and 3 microservices and you want them all to be available on the same domain:

  • should load frontend service

  • should load service-commerce service

  • should load service-content service

  • should load service-search service

You have to create a routing manifest to achieve this. (In addition to pointing the domain in question to your Kubernetes cluster during infra generation)

Create manifest

In your infra directory, create a directory named routing and place a file called .cxcloud.yaml inside it:

ssl: true
- path: /api/service-commerce
serviceName: service-commerce
servicePort: 4003
- path: /api/service-content
serviceName: service-content
servicePort: 4003
- path: /api/service-search
serviceName: service-search
servicePort: 4003
- path: /
serviceName: frontend
servicePort: 80

Please note that path should match the API prefix you defined when generating the service with CLI. By default, during service generation CX Cloud CLI suggests service name as the API prefix.


Now navigate to the routing directory and run cxcloud deploy:

$ cd infra/routing
$ cxcloud deploy

This command will "deploy" your routing manifest to your Kubernetes cluster. It shoudn't take more than a few seconds for the changes to be applied.


To test for example commerce service, should return {"health":"OK"} and should present you Swagger.

If you are interested to know what does this command do, please read the manual routing setup guide.