Environments configuration

Environments configuration is based on GIT repositories with JSON configuration files. Starting point of the configuration (main repository) is configured in OpsControl configuration.

When the environment is configured the repository is clonned, config.json file from the root directory loaded and appropriate Concourse teams and Credhub variables created.

The file should contain single array of objects called envs. Each object represents single environment. Configured name is also a name of a subdirectory in the repository set as a environment configuration source.

Hint

Single repository can be used for all environments configuration. Each environment use subdirectory and names can't overlap which makes it easy to have everything in one place.

Structure

Environment configuration consist of strict structure of files put in directory with the same name as a configured environment name.

In the environment directory there is one file and two subdirectories. The common.json file contains configuration common for both infrastructure of the environment and the deployments.

The infrastructure subdirectory contains single file: env.json which has configuration of BOSH and all of the tools deployed in the environment.

The bosh_deployments subdirectory contains configuration files for each deployed component and its deployment pipelines. By default it contains Kubernetes configuration file and Cloud Foundry configuration file.

config.json

- prod
  - bosh_deployments
    - cf-deployment.json
    - k8s-deployment.json
  - infrastructure
    - env.json
  common.json

- dev
  - bosh_deployments
    - cf-deployment.json
    - k8s-deployment.json
  - infrastructure
    - env.json
  common.json

Structure of single environment object:

  • name - name of the environment, it will prefix all created resources and also will be a default team name in concourse.
  • backend_type - backend type of environment. Can be one of the following (aws|azure|openstack|vsphere)
  • config_repo_url - URL to the environment configuration repository, can be same as the main configuration repository.
  • config_repo_branch - Name of the configuration repository branch.

Example

{
    "envs": [
         {
            "name": "env1",
            "backend_type": "openstack",
            "config_repo_url": "git@ssh.dev.azure.com:v3/grape-up/cloudboostr/cb-config",
            "config_repo_branch": "verification-citycloud"
        }
    ]
}