Manage extension files
It is recommned to use annotations instead of extension files, as annotations help ensure consistency across your enviroments and deployments, since your Workload information is stored in one file.
Score supports extension files.
humanitec.score.yamlextension is used by
score-humanticScore implementation (CLI). This is an optional configuration specific for Humanitec’s routes as a resource and services accounts.
Applications that consist of multiple microservices typically need a routing controller that redirects incoming requests to a proper Workload at run time.
For example, a common scenario is to deploy an API Gateway, Ingress controller, or Service mesh as part of your application. Maintaining and updating routing tables after new service deployments is a point of friction as the application scales.
With Score, you can include advertised routes details as part of the Workload definition, allowing you to rebuild and update route tables during the deployment process.
Routes convert into resource definitions, so proper routes can be provisioned at the time of deployment based on the target environment and other parameters.
The Score Specification file has a concept of a Workload specification that defines the requirements to run a Workload, but isn’t used to manage Target Configuration or to provision any of the dependencies.
For more information, see Score Specification.
Because of this, define routes as a dependency, or as a resource, that can be referenced in other parts of the Score Specification file.
Routes are just like any other resources. For example, a
route would have the name
id and a set of attributes like
The values of the attributes are available to the Workload at the time of deployment, after the provision of resources takes place.
A microservice Workload needs to generate a self-reference in an e-mail that is automatically sends to a user. To build such reference, the service needs to know a full domain, subdomain name, and prefix. Then the service would append a dynamically generated part of the URL that has a unique request IDs to identify the user.
Network configurations may differ depending on the environment setup.
In the following example,
URL_PREFIX are configured through the environment variables for the microservice and
route are two resources that act as dependencies essential for the service’s functionality.
Humanitec Workload implementation
When translated by
score-humanitec, two Workload resources reference would be created in the deployment delta, one for
dns and one for
route. These would be resolved to actual values based on the configuration specified by the DevOps for the target environment.