Group config file

DragonOps’ goal is to make customizing your infrastructure delightful and simple. We have abstracted the more complex pieces of networking, cluster and environment management so that you can focus on what you care about: deploying cool shit.

That being said, we also want our users to be able to customize what they care about if they want to!

The group config file can be used to customize your base infrastructure so that it fits your specific needs.

Contents

  1. Structure
  2. Default group config file
  3. Cross-group references

Structure

Each resource will always have the following two parts: a resource_label and type.

The resource_label is the top-level field of a resource declaration in the yaml. Resource labels must be unique per group. For example, you can only have one network with a resource label of preprod_network in a group single config file.

For a list of all resource types and their associated configuration, check out this

group

A group resource is something that must be defined exactly once per config file, and acts as an organizational resource.

Field name Field type Default value Required
type string always group true
name string same as resource_label false
account string none true
region string us-east-1 false
custom_route_53 map/object/dict none false

custom_route_53

Custom Route 53 is defined at the group-level, and all resources (ie clusters, grafana, etc) will inherit the same DNS defined in the group. Additionally, applications deployed to an environment in the group will inherit it’s DNS as well. If no custom DNS is provided, DragonOps will create a hosted zone as a subdomain of our DNS for the group (ie: choice-pickle.client.dragonops.io).

Field name Field type Default value Required
enabled string none true
domain_name string none true

Example

preprod_group:   # <---- resource_label
  type: group    # <---- type
  name: preprod
  account: "AWS_ACCOUNT_NUMBER"

Default group config file

By default, running the dragonops group add will generate asdragonops-preprod.yml like the one below. This config balances cost-optimization with keeping resources separate according to best practices.

This is done by having a single preprod group, with one cluster (main) and one network (main). Separate, preproduction environments are deployed to the single main cluster, so that you can have multiple environments without breaking the bank.

# DragonOps creates both a dev and stage environment in the preprod group, so you have two environments to deploy applications to right away.
dev_environment:
  type: environment
  name: dev
  cluster: preprod_group.main_cluster

# DragonOps creates a main network that can house multiple clusters for cost-optimization.
main_cluster:
  type: cluster
  name: main
  network: preprod_group.main_network
  grafana:
    enabled: true
    subdomain: monitoring

# DragonOps creates a main cluster that can house multiple environments for cost-optimization.
main_network:
  type: network
  name: main
  cidr: 10.100.0.0/16

# By default, DragonOps creates a single group (default is preprod) that can be used for multiple environments for cost-optimization.
preprod_group:
  account: "035473786027"
  region: us-east-1
  type: group
  name: preprod

# DragonOps creates both a dev and stage environment in the preprod group, so you have two environments to deploy applications to right away.
stage_environment:
  type: environment
  name: stage
  cluster: preprod_group.main_cluster

Cross-group references

It is possible to reference resources in another group.

DragonOps depends on dot notation for referencing resources in other groups, where the group resource_label is the first value.

For example, if you have a group called dev_group and a group called data_group, and you want to deploy your environment called data_dev (in the dev_group) into a cluster managed by the dev_group, you would simply list dev_group.dev_cluster in the cluster field for your data_dev environment.

The two group files below represent the cross-group referencing example described above.

# dev_group.yml
dev_group:
  account: "AWS_ACCOUNT_NUMBER"
  type: group
  name: dev

dev_network:
  type: network
  name: dev

dev_cluster:
  type: cluster
  name: dev
  network: dev_group.dev_network  # <-- reference to network in same group config file (dev_group)
# data_group.yml
data_group:
  account: "AWS_ACCOUNT_NUMBER"
  type: group
  name: data
  
data_dev:
  type: environment
  name: data_dev
  cluster: dev_group.dev_cluster  # <-- reference to cluster in the dev_group (a different group config file)

Table of contents