Log In


You can use the ketch.yaml file to describe certain aspects of the application you are deploying.

Use the file to describe detailed information about deployment hooks and application processes you want Ketch to use during application deployments.

Deployment Hooks

Ketch provides different deployment hook options, such as restart:before and restart:after. Deployment hooks allow you to run commands during different stages of the application deployment.

Below is an example of how to declare hooks in the ketch.yaml file:

      - python -c 'import datetime; print("before " + str('
      - python -c 'import datetime; print("after " + str('

Currently, you can use the ketch.yaml file with the following hooks:

  • restart:before: executes commands before the unit is restarted. Commands listed in this hook run once per unit. For instance, if there is an application with two units and the ketch.yaml file listed above, the command python local_file would run two times, once per unit.
  • restart:after: works like before-each, but runs after restarting a unit.

Kubernetes Processes

When running your application on a Ketch provisioned framework/namespace, you can set specific Kubernetes-related configurations for your application.

You can configure which ports are exposed to each process of the application. Here is a complete example:

        - name: apache-http # an optional name for the port
          protocol: TCP 
          port: 80 # The port that is going to be exposed on the router.
          target_port: 9999 # The port on which the application listens on.
        - name: http 
          protocol: TCP
          port: 80
      ports: []

Each exposed port can be configured for each process using the port's key:

  • kubernetes:processes::ports:name: is a descriptive name for the port. This field is optional.
  • kubernetes:processes::ports:protocol: defines the port protocol. The accepted values are TCP (default) and UDP.
  • kubernetes:processes::ports:target_port: is the port that the process is listening on. If omitted, the port value is used.
  • kubernetes:processes::ports:port: is the port that will be exposed on a Kubernetes service. If omitted, the target_port value is used.

If both port and target_port are omitted in a port config, the deployment fails.

Developers can set a process to expose no ports with an empty field, like the worker above.