Core ConceptsDeployments

Understanding Deployments in Ctrlplane

Deployments in Ctrlplane are the central organizing principle for managing and orchestrating the release of your software or infrastructure across various environments within a system. A deployment represents a complete, end-to-end process for delivering changes to your system, encompassing everything from the initial code commit to the final production release.

What is a Deployment?

A deployment in Ctrlplane is:

  1. A Logical Unit: It typically represents a single service, application, or piece of infrastructure.

  2. System-Bound: Each deployment is assigned to a specific system, which contains multiple environments (e.g., QA, Staging, Production). When you create a deployment, it automatically becomes part of all environments within that system.

  3. Version Control: It manages multiple releases (versions) of your software or infrastructure configuration.

  4. Pipeline Definition: It includes a defined CI/CD pipeline that outlines the steps for building, testing, and deploying your changes.

  5. Release Manager: It groups and organizes releases, providing a historical view of all deployments.

Key Components of a Deployment

A deployment in Ctrlplane typically includes:

  1. Releases: Individual versions of your software or infrastructure configuration.

  2. CI/CD Pipeline: The defined process for deploying releases.

  3. System and Environment Association: The deployment is part of all environments within its assigned system, allowing for consistent deployment across different stages.

  4. Job Configurations: Specifications for the jobs that will be created and run for each release and resource.

  5. Variables: Resource-specific variables that allow the same pipeline to be used across different environments.

Systems, Environments, and Resource Filtering

Ctrlplane uses a hierarchical structure to manage deployments:

  1. Systems: The top-level organizational unit. A system contains multiple environments and is associated with one or more deployments.

  2. Environments: Subsets of a system (e.g., QA, Staging, Production). Each environment can be configured with specific settings and policies.

  3. Environment Configuration: Each environment is configured with label filters to determine which resources fall under that environment. This allows for fine-grained control over where deployments are applied.

  4. Resource Filtering: When a release is created, Ctrlplane uses the environment’s label filters to identify matching resources. It then runs the appropriate jobs for each of these resources.

  5. Inter-Environment Policies: Environments are connected by policies that determine when and how jobs should run. These policies control the progression of deployments through environments (e.g., from Staging to Production).

Deployment Workflow

  1. Deployment Creation: A deployment is created and assigned to a system.

  2. Release Initiation: A new release is created within the deployment.

  3. Environment Processing: For each environment in the system:

    • The environment’s label filters are applied to identify relevant resources.
    • Jobs are created for each matching resource based on the deployment’s job definitions.
  4. Policy Enforcement: Inter-environment policies determine when jobs can run, allowing for controlled progression through environments.

  5. Job Execution: Jobs are executed on the identified resources, applying the release changes.

Creating and Managing Deployments

Deployments can be created and managed in two primary ways:

  1. Manual Creation: Through the Ctrlplane UI or API, specifying the system it belongs to.

  2. Automated Creation: By including a .ctrlplane.yaml file in your Git repository. This method allows for automatic deployment creation when new repositories are added, with system assignment specified in the configuration.

Example .ctrlplane.yaml:

Ctrlplane
© 2024 Ctrlplane. All rights reserved.