Services
Each service described in an architect.yml
file will automatically be deployed
to its own horizontally scaling replica with load balancing seamlessly between
instances.
Configuration options
build
(optional) An object containing the details necessary for Architect to build the
service via Docker. Whenever a service that specifies a build
field is
registered with Architect, the CLI will trigger a docker build
and replace the
build
field with a resolvable image.
image
fieldUsing buildpack
Buildpack is currently in alpha. While the feature should be stable, it may be changed or removed without prior notice. As such we do not recommend using this feature in any automated pipelines. During this time we greatly appreciate any feedback as we continue to finalize the implementation. You can reach us at support@architect.io. If a
Dockerfile
is not found in the directory in which thecontext
field is set, the CLI by default will trigger a Cloud Native Buildpacks builder to build an image of the service. A builder is an image that detects and converts source code into a runnable container image.
If the application contains a Dockerfile
but a builder should be used instead, set the field buildpack
to true
.
Architect buildpack
is in its early development stage and is currently an experimental feature. The version of the builder image is heroku/buildpacks:20
. This builder version only supports languages such as Java, Go, Node.js, PHP, Python, Ruby, Scala, and Typescript. Learn more about Heroku’s builder.
Depending on the language that the application is written in, there might be some requirements in order to build successfully. For example, if an application is written in Java, only these supported Java versions can be used. After selecting a Java version, a system.properties
might be required at the root of the application for the builder to use the correct Java runtime version.
For more information on the language support of Heroku, please refer to Heroku language support.
image
fieldimage
image (optional) A string referencing the address of an existing docker image that powers this service.
build
fieldcommand
(optional) A string or string[] specifying the command to be used to start up
the service inside the container. If no value is specified, the default CMD
from the associated image will be used.
entrypoint
(optional) A string or string[] specifying the entrypoint to be used to start up
the service inside the container. If no value is specified, the default
ENTRYPOINT
from the associated image will be used.
interfaces
A dictionary containing a set of named interfaces that the service listens for requests on. Each interface must at minimum specify the port it is listening for requests on.
To learn about how to expose your services see ingress rules.
Since many services use http for traffic, interfaces also support a simple short-hand for specifying the service port:
Overriding service hosts
Architect supports overriding a service with the URL of an external host. When this is done, the service will not be created by Architect, but all of the interpolated values of the service will continue to be produced. This is a common pattern in cases where a user wants Architect to manage everything for local development, but wants to reference a managed service such as a database instance for staging or production. For example, the service below represents a Postgres database service that can be either managed by Architect or effectively an external reference:
The secret postgres_host
will determine whether or not the service will be
provisioned by Architect. If postgres_host
is not set, Architect will
provision the api-db
service and create a postgres:11
container. If the
postgres_host
secret is set, image: postgres:11
will be ignored and the
container will not be provisioned by Architect. Any interpolated values that
include the api-db
service will produce the correct output in either instance
with the difference being that ${{ services.api-db.interfaces.postgres.host }}
and ${{ services.api-db.interfaces.postgres.url }}
will change based on the
host
of the interface. Note that if a service has multiple interfaces and you
would like to reference an external service, all of the Architect service’s
interfaces must specify the host
override.
Cusomt SSL Certificates (EXPERIMENTAL)
By default the Architect platform will provision SSL certificates for your website using Let’s Encrypt. However, sometimes you may wish to provide your own SSL certificates. To do this we you can specify them as part of the service.
The tls
subsection of the ingress allows you to specify an SSL certificate. The crt
field is the signed certificate and the key
is the private key used to encrypt the data from the server. The ca
field is an optional field. When set this will override the which CA root certificate will be used to authenticate connections with the server. Primarly this should only be set when trying to limit which connections should be allowed to this server.
(NOTE): While you do specify a custom SSL certificate on an ingress, the certificate will be used for all matching domain names. So if you have a wild card certificate, then all domains that match the wildcard will use the same certificate.
labels
Dictionary of string keys and values that can be used to organize and categorize (scope and select) the service.
Syntax and character set Labels are key/value pairs. Valid label keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 63 characters in total, followed by a slash (/).
Valid label value: must be 63 characters or less (can be empty), unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]), could contain dashes (-), underscores (_), dots (.), and alphanumerics between.
liveness_probe
This configuration is essentially the health check for the service. It’s important to specify so that traffic isn’t load balanced to unhealthy services. Critical for rolling updates to function properly.
environment
A key-value store of environment variables to be injected into the service runtime.
volumes
(optional) A dictionary containing a set of named volumes that the service will request and mount to each service instance. Architect can take advantage of volumes to store data that should be shared between running containers or that should persist beyond the lifetime of a container.
Local configuration
If you would like to use the local filesystem as a volume or a docker-compose
volume, use the options below in the debug block of your service:
cpu & memory
cpu
: a whole number or decimal that represents the vCPUs allocated to the
service when it runs.
memory
: a string that represents the memory allocated to the service when it
runs.
depends_on
depends_on
takes an array of references to other services within the
component. These dictate startup order: at deployment time, services will not be
started until any of their listed dependents have already started.
replicas
(optional) The number of replicas the service should have when it’s deployed. This number will apply across environments unless overridden by an environment-specific setting.
Local development
When developing your service locally you may want to mount volumes or alter the command that is used in remote environments. Learn more about how to specify with local configuration.