Quick start: Creating Environments

Explore how environments empower application promotion and deployment

In the previous quick start, you created a Git Source for the GitOps Runtime. In this quick start, we’ll focus on creating ennvironments in preparation for promoting and deploying applications.

Environments are essential for managing the lifecycle of your applications as they move from development to production. Whether it’s a testing environment, a staging area, or production itself, each environment serves a unique purpose in the software delivery process.

In the context of promotions with Codefresh GitOps, environments aren’t just configurations—they’re actionable entities. They give you an intuitive way to organize, track, and promote applications, ensuring consistency and clarity across your delivery lifecycle.
Environments are tightly integrated with GitOps principles, ensuring that your infrastructure and applications are always in sync with declarative configurations stored in Git.

Quick start: Representation of an Environment in Codefresh GitOps

Quick start: Representation of an Environment in Codefresh GitOps

For detailed information, see Environments.

Why create environments?

Environments are key to managing and promoting applications effectively.
They give you a structured, intuitive way to answer the question: What’s running where?

Here are just a few of the reasons you’ll want to use environments in Codefresh:

  • Mirror your SDLC
    Environments are designed to mirror your software development life cycle (SDLC). By aligning applications with their development stages, environments offer a clear and contextual view of the entire application lifecycle, as it moves from development to production.

  • Simplify promotions
    Environments make promoting applications between stages seamless. By organizing applications into environments, you always know what’s ready for the next stage, reducing confusion and ensuring consistency.

  • Effortless creation
    Creating an environment in Codefresh is simple. Just provide a unique name, and map clusters and namespaces.

Quick start: Environments in Codefresh GitOps

Quick start: Environments in Codefresh GitOps

Create an Environment

Let’s go ahead and create an environment.

Environments mirror the deployment lifecycle of your software, so create as many as you need to match your process. Common examples include development, qa, staging, and production, but you can customize environments to fit your needs. There’s no cap on the number of environments you can create.

For this quick start, we’ll create three environments, dev, qa, and prod.

  1. In the Codefresh UI, from the sidebar, select Environments, and then click Add Environment.
  2. Define the following:
    1. Name: A unique name for your environment, which is meaningful in the context of your development and deployment cycle. For the quick start, we’ll use dev.
    2. Kind: The purpose of the environment. Select Non-production where typically development, testing, and staging versions of applications are deployed.
      The Kind property is used to also define rules for promotions and ABAC (Attribute Based Access Control) permissions.
    3. Tags: Leave this empty for the quick start.
    4. Clusters and Namespaces: Single or multiple clusters, namespaces, or cluster-namespace pairs, to map to the environment. To include all namespaces in a cluster, leave the Namespace empty. For the quick start, we’ll add the in-cluster and the demo-dev namespace.

Environments quick start: Create an Environment

Environments quick start: Create an Environment
  1. Click Add.
    The environment is displayed in the Environments dashboard.
  2. Repeat step 1 through step 3 to create the two other environments: qa and prod.
    For the quick start, both environments are mapped to in-cluster, and to namespaces, demo-qa and demo-prod respectively.

Here’s an example of the Environments dashboard with the three environments. The environments are automatically populated with the applications in the clusters and namespaces mapped to them.
At this point, as we haven’t created any applications, all environments are empty.

Environments quick start: Newly created environments without applications

Environments quick start: Newly created environments without applications

What’s next

You’re probably eager to dive into applications. Before we do that let’s create another entity that simplifies and supercharges applications: Products.

Quick start: Creating products