Updating infra specs for project clusters

This is the reference documentation for the structure of the clusters.yaml config file which contains the infrastructure specifications for clusters required by a project.

What is clusters.yaml

clusters.yaml is a file containing the configuration of your infrastructure. It is located at the top-level of a Hasura project directory.

The idea is to have a declarative configuration of your infrastructure so that you can create instances of your infra on-demand.

As this configuration is in a file, it can be version controlled. Hence all is required to create, replicate or move your app (Hasura project) in a new instance is to create a cluster according to this config and push your project to the cluster.

Structure

The clusters.yaml file is a YAML file containing information about your clusters.

It contains the alias as well as the infra spec for the cluster.

Following fields make up the infra spec:

  • version : A Version string
  • provider : Provider name.
  • region or zone : Region or Zone of the cluster
  • nodes : A list of Node of the cluster.
  • volumes : A list of Volume of the cluster.
version: v1
provider: digital-ocean
region: blr1
nodes:
- type: s-2vcpu-4gb
  labels:
    app: postgres
volumes:
- name: postgres
  size: 10
- name: filestore
  size: 30
- name: sessionstore
  size: 5
# custom volume
- name: my-volume
  size: 10

Version

Version of the spec. This is an internal key. It is currently v1.

String

Provider

Name of the provider. It can be any of the following:

  1. digital-ocean
  2. gke
String

Region

The slug (string value) of the region name of the provider.

Currently, slug of any valid Digital Ocean region. See this link for all valid regions https://developers.digitalocean.com/documentation/v2/#list-all-regions

String

Zone

The slug (string value) of the zone name of the provider.

Currently, slug of any valid Google Cloud zone. See this link for all valid zones https://cloud.google.com/compute/docs/regions-zones/

String

Note

All zones do not have GKE support. Please see Hasura pricing to see all the available zones.

Node

An object containing the type of node/machine and its labels.

{
    "type" : NodeType,
    "labels": Label

}

Volume

An object containing the name of the volume and its size in GB.

{
    "name" : String,
    "size" : DiskSize
}

NodeType

The type of node (or machine) to be used. Basically, this type represents the CPU, memory (optionally disk size) of the VM or node. The value of this field is provider specific.

For digital-ocean, the value of this field is any valid slug in this list: https://developers.digitalocean.com/documentation/v2/#list-all-sizes

For gke, the value of this field is any valid slug in this list: https://cloud.google.com/compute/docs/machine-types

Label

An object of key value pairs. You can use labels to tag your nodes.

These labels can also be used in your Kubernetes manifests as node selectors.

{
    String : String,
    String : String,
    ..
}

DiskSize

An integer value in GigaBytes (GB). This value cannot be zero.

String

Any string value.

Examples

For sample clusters.yaml configurations, see this.