The following is a full reference for all the fields that can be set for a web service in porter.yaml.

  • autoscaling - the autoscaling configuration for the service.
    • enabled - whether autoscaling is enabled or not.
    • minInstances - the minimum number of instances to run.
    • maxInstances - the maximum number of instances to run.
    • cpuThresholdPercent - the CPU threshold percentage to trigger autoscaling at.
    • memoryThresholdPercent - the memory threshold percentage to trigger autoscaling at.
  • domains - the list of custom domains for the service, if the service is exposed publicly.
    • name - the name of the domain.
  • private - whether the service is private or not.
  • healthCheck - the health check configuration for the service.
    • enabled - whether the health check is enabled or not.
    • httpPath - the path to check for the health check.
  • ingressAnnotations - the ingress annotations to apply for the service.
  • pathRouting - the list of URL paths to service port mappings, if path-based routing is enabled. Note that a path must be specified for the default port (set in services.port). If routing to a port on a different service, the port must be exposed on that service (either as the default port or through a path routing rule).
    • path - the URL path.
    • port - the port to route to.
    • appName - (optional) the name of the application to route to (as it appears in the dashboard). Defaults to the application of the current service.
    • serviceName - (optional) the name of the service to route to (as it appears in the dashboard). Defaults to the current service. Must be specified if appName is set.
  • rewriteCustomPaths - when path routing is enabled, whether to rewrite custom paths to the root path. Defaults to true.

autoscaling

object - optional

All fields are optional.

autoscaling:
  enabled: true
  minInstances: 1
  maxInstances: 10
  cpuThresholdPercent: 80
  memoryThresholdPercent: 80

domains

array - optional

domains:
  - name: example.com

private

boolean - optional

private: true

healthCheck

object - optional

healthCheck:
  enabled: true
  httpPath: /health

ingressAnnotations

object - optional

ingressAnnotations:
  nginx.ingress.kubernetes.io/proxy-connect-timeout: '"18000"'

pathRouting

array - optional

pathRouting:
  - path: /api/v1
    port: 8080
  - path: /api/v2
    port: 8081
  - path: /api/v3
    port: 8082
    serviceName: other-service-in-same-app
  - path: /api/v4
    port: 8083
    appName: other-app
    serviceName: other-service-in-other-app

rewriteCustomPaths

boolean - optional (defaults to true)

pathRouting:
  - path: /api/v1
    port: 8080
  - path: /api/v2
    port: 8081
rewriteCustomPaths: false