Skip to main content

Map your Datacenters

OpenContext allows you to group code components and platform components by location. These locations can be added by creating a Datacenter YAML file describing the location.

Gather information

To add this additional data, we will need a few things:

  • Who's responsible for the datacenter? This can be a team or a person
  • What type of datacenter is this (cloud, on-premise, other)?
  • Optionally, what region is the datacenter in?
  • Optionally, is there a PagerDuty service-id or integration-key associated with this datacenter? If so a PagerDuty annotation would be added.

Examples

The following are examples of how you would define various types of datacenters.

For cloud datacenters it is recommended that you at least create a datacenter per cloud per region
These example YAML configurations are all shown as if they were in their own file. They can be concatenated into a single file by separating the contents with a triple dash --- like in Kubernetes.
The field metadata.name must be unique!

In this example we are defining a datacenter for AWS us-east-1. Who's responsible is the cloud-team. This is mapped to the owner field. The PagerDuty service-id is also known. It is mapped to the metadata.annotations.

apiVersion: opencontext.com/v1alpha1
kind: Datacenter
metadata:
name: aws-us-east-1
title: AWS us-east-1
description: Amazon Web Services in us-east-1
annotations:
pagerduty.com/service-id: 'TEST7XW'
spec:
type: cloud
owner: [cloud-team]
region: us-east-1

In this example we are defining a datacenter for GCP us-central1-c. Who's responsible is the cloud-team. This is mapped to the owner field. The PagerDuty integration-key is also known. It is mapped to the metadata.annotations.

apiVersion: opencontext.com/v1alpha1
kind: Datacenter
metadata:
name: gcp
title: GCP
description: Google Cloud Platform
annotations:
pagerduty.com/integration-key: 'e0efde5a1somethingorother'
spec:
type: cloud
owner: [cloud-team]
region: us-central1-c

In this example we are defining an on-premise datacenter called Datacenter 1. Who's responsible is the it-team. This is mapped to the owner field. The PagerDuty integration-key is also known. It is mapped to the metadata.annotations.

The default type of oncall is a team.
apiVersion: opencontext.com/v1alpha1
kind: Datacenter
metadata:
name: dc1
title: Datacenter 1
description: Datacenter 1
annotations:
pagerduty.com/integration-key: 'e0efde5a1somethingorother2'
spec:
type: other
otherType: dc1
owner: [it-team]
region: us-east

In this example we are defining an vendor's datacenter called Vendor 1. Who's responsible is the it-team. This is mapped to the owner field. Since they are not on-call for this datacenter no PagerDuty annotation is added.

apiVersion: opencontext.com/v1alpha1
kind: Datacenter
metadata:
name: vendor
title: Vendor 1
description: Vendor 1's Datacenter
spec:
type: other
otherType: vendor
owner: [it-team]
region: us-east