App Manifest

Reference guide for the application manifest.yml format.

App manifests provide a way for developers to record their App’s execution environment in a declarative way. They allow Apps to be deployed consistently and reproducibly.

Format

Manifests are YAML files in the root directory of the App. They must be named manifest.yml or manifest.yaml.

Kf App manifests are allowed to have a single top-level element: applications. The applications element can contain one or more application entries.

Application fields

The following fields are valid for objects under applications:

FieldTypeDescription
namestringThe name of the application. The app name should be lower-case alphanumeric characters and dashes. It must not start with a dash.
pathstringThe path to the source of the app. Defaults to the manifest’s directory.
buildpacksstring[]A list of buildpacks to apply to the app.
stackstringBase image to use for to use for apps created with a buildpack.
dockerobjectA docker object. See the Docker Fields section for more information.
envmapKey/value pairs to use as the environment variables for the app and build.
servicesstring[]A list of service instance names to automatically bind to the app.
disk_quotaquantityThe amount of disk the application should get. Defaults to 1GiB.
memoryquantityThe amount of RAM to provide the app. Defaults to 1GiB.
cpuquantityThe amount of CPU to provide the application. Defaults to 1/10th of a CPU.
cpu-limitquantityThe maximum amount of CPU to provide the application. Defaults to unlimited.
instancesintThe number of instances of the app to run. Defaults to 1.
routesobjectA list of routes the app should listen on. See the Route Fields section for more.
no-routebooleanIf set to true, the application will not be routable.
random-routebooleanIf set to true, the app will be given a random route.
timeoutintThe number of seconds to wait for the app to become healthy.
health-check-typestringThe type of health-check to use port, process, none, or http. Default: port
health-check-http-endpointstringThe endpoint to target as part of the health-check. Only valid if health-check-type is http.
health-check-invocation-timeoutintTimeout in seconds for an individual health check probe to complete. Default: 1.
commandstringThe command that starts the app. If supplied, this will be passed to the container entrypoint.
entrypointstringOverrides the app container’s entrypoint.
argsstring[]Overrides the arguments the app container.
portsobjectA list of ports to expose on the container. If supplied, the first entry in this list is used as the default port.
startupProbeprobeSets the app container’s startup probe.
livenessProbeprobeSets the app container’s liveness probe.
readinessProbeprobeSets the app container’s readiness probe.
metadataobjectAdditional tags for applications and their underlying resources.

† Unique to Kf

Docker fields

The following fields are valid for application.docker objects:

FieldTypeDescription
imagestringThe docker image to use.

Route fields

The following fields are valid for application.routes objects:

FieldTypeDescription
routestringA route to the app including hostname, domain, and path.
appPortint(Optional) A custom port on the App the route will send traffic to.

Port fields

The following fields are valid for application.ports objects:

FieldTypeDescription
portintThe port to expose on the App’s container.
protocolstringThe protocol of the port to expose. Must be tcp, http or http2. Default: tcp

Metadata fields

The following fields are valid for application.metadata objects:

FieldTypeDescription
labelsstring -> string mapLabels to add to the app and underlying application Pods.
annotationsstring -> string mapAnnotations to add to the app and underlying application Pods.

Probe fields

Probes allow a subset of functionality from Kubernetes probes.

A probe must contain one action and other settings.

FieldTypeDescription
failureThresholdintMinimum consecutive failures for the probe to be considered failed.
initialDelaySecondsintNumber of seconds to wait after container initialization to start the probe.
periodSecondsintHow often (in seconds) to perform the probe.
successThresholdintMinimum consecutive successes for the probe to be considered successful.
timeoutSecondsintNumber of seconds after a single invocation of the probe times out.
tcpSocketTCPSocketAction objectAction specifying a request to a TCP port.
httpGetHTTPGetAction objectAction specifying a request to a TCP port.

TCPSocketAction fields

Describes an action based on TCP requests.

FieldTypeDescription
hoststringHost to connect to, defaults to the App’s IP.

HTTPGetAction fields

Describes an action based on HTTP get requests.

FieldTypeDescription
hoststringHost to connect to, defaults to the App’s IP.
pathstringPath to access on the HTTP server.
schemestringScheme to use when connecting to the host. Default: http
httpHeadersarray of {"name": <string>, "value": <string>} objectsAdditional headers to send.

Examples

Minimal App

This is a bare-bones manifest that will build an App by auto-detecting the buildpack based on the uploaded source, and deploy one instance of it.

---
applications:
- name: my-minimal-application

Simple App

This is a full manifest for a more traditional Java App.

---
applications:
- name: account-manager
  # only upload src/ on push
  path: src
  # use the Java buildpack
  buildpacks:
  - java
  env:
    # manually configure the buildpack's Java version
    BP_JAVA_VERSION: 8
    ENVIRONMENT: PRODUCTION
  # use less disk and memory than default
  disk_quota: 512M
  memory: 512M
  # Give the app a minimum of 2/10ths of a CPU
  cpu: 200m
  instances: 3
  # make the app listen on three routes
  routes:
  - route: accounts.mycompany.com
  - route: accounts.datacenter.mycompany.internal
  - route: mycompany.com/accounts
  # set up a longer timeout and custom endpoint to validate
  # when the app comes up
  timeout: 300
  health-check-type: http
  health-check-http-endpoint: /healthz
  # attach two services by name
  services:
  - customer-database
  - web-cache

Docker App

Kf can deploy Docker containers as well as manifest deployed App. These Docker Apps MUST listen on the PORT environment variable.

---
applications:
- name: white-label-app
  # use a pre-built docker image (must listen on $PORT)
  docker:
    image: gcr.io/my-company/white-label-app:123
  env:
    # add additional environment variables
    ENVIRONMENT: PRODUCTION
  disk_quota: 1G
  memory: 1G
  # Give the app a minimum of 2 full CPUs
  cpu: 2000m
  instances: 1
  routes:
  - route: white-label-app.mycompany.com

App with multiple ports

This App has multiple ports to expose an admin console, website, and SMTP server.

---
applications:
- name: b2b-server
  ports:
  - port: 8080
    protocol: http
  - port: 9090
    protocol: http
  - port: 2525
    protocol: tcp
  routes:
  - route: b2b-admin.mycompany.com
    appPort: 9090
  - route: b2b.mycompany.com
    # gets the default (first) port

Health check types

Kf supports three different health check types:

  1. port (default)
  2. http
  3. process (or none)

port and http set a Kubernetes readiness and liveness probe that ensures the application is ready before sending traffic to it.

The port health check will ensure the port found at $PORT is being listened to. Under the hood Kf uses a TCP probe.

The http health check will use the configured value in health-check-http-endpoint to check the application’s health. Under the hood Kf uses an HTTP probe.

A process health check only checks to see if the process running on the container is alive. It does NOT set a Kubernetes readiness or liveness probe.

Known differences

The following are known differences between Kf manifests and CF manifests:

  • Kf does not support deprecated CF manifest fields. This includes all fields at the root-level of the manifest (other than applications) and routing fields.
  • Kf is missing support for the following v2 manifest fields:
    • docker.username
  • Kf does not support auto-detecting ports for Docker containers.