Build & Config
Service configuration options
Overview
Service configurations allow you to customize many aspects of a Cloud 66 services. These are defined in the service.yml
file. If you're unfamiliar with service configurations, please read our introductory guide first.
Service configuration options
This is the complete list of all service configuration directives in both versions of Cloud 66. For more detailed information about an option, click the link provided.
Option | Description |
---|---|
annotations | Annotations for your services in key/value format - these will also become annotations on your Kubernetes resources |
build_command | Specifies the command you would like to run during application build. |
build_root | Specifies the directory of your repository in which you wish to run your Docker build. |
command | Specifies the command used to start your container. |
constraints | Limits the number of containers or the resource usage of a service across the cluster, or allocates services to nodes based on names and/or tags. |
constraints/tolerations | This is an optional hash for advanced configuration of Kubernetes Tolerations. |
deploy_command | Specifies the command you would like to run during application deploy (runs once per service). |
dns_behaviour | Specifies the dns behaviour for this service. Accepted values: versioned, non-versioned. Defaults to versioned. |
dockerfile_path | Specifies the location of the Dockerfile to be used for building this service, eg. docker/Dockerfile. |
git_url | The URL for the Git repository from which your Docker image will be built. |
git_branch | The Git repository branch your Docker image will be based on. |
use_habitus | Use Habitus build workflow |
use_habitus_step | The Habitus step to use for the build. |
health | One of the values: default, none or a hash. Use this to configure Readiness, Liveness, and Startup probes |
image | The image you would typically run docker pull from. |
load_balancing | Specifies the load balancing method for this service. Accepted values: roundrobin, sticky, closest. Default value is roundrobin |
log_folder | Specify the folder on your container in which your services will save logs. This folder is mounted to /var/log/containers/NAMESPACE/SERVICE_NAME on the host filesystem. (more about namespace and service name) |
ports | The ports that are running within the container, as well as their corresponding external ports. |
post_start_command | This command runs immediately after a container is created. |
pre_stop_command | This command runs immediately before a container is terminated. |
requires | Array of other defined service names that should be started before this service during build and deployment. |
restart_on_deploy (default: true) | Boolean value to indicate whether the containers of this service should be restarted during deployment. |
security_context | This is an optional hash for advanced configuration of Kubernetes Security Context. Valid keys are: fs_group, host_ipc, host_network, host_pid, privileged, run_as_group, run_as_non_root, run_as_user, supplemental_groups. |
service_account_name | Assigns the service to a specific Kubernetes Service Account. The default value is default |
stop_grace | Duration between the Docker TERM and KILL signals when Docker stop is run and a container is stopped. |
traffic_matches | The automatically configured traffic names in your Nginx config that will route traffic to these containers based on request DNS name. Allows microservices on the same port routes by subdomain for instance. |
tags | Arbitrary text tags for your services - these will also become labels on your Kubernetes resources |
type | Specifies the type of service being defined. Accepted values: service , deployment , daemon_set |
volumes | The volumes that are mounted from your host into your container. Note Must use absolute paths. |
work_dir | Specifies the working directory in your image for any command to be run. |