DEV Community

Aisalkyn Aidarova
Aisalkyn Aidarova

Posted on

Developer CI Dev Stage Production

explained:

  • Why each exists
  • What happens in each
  • Who is responsible
  • How Argo CD handles it

πŸ”· STEP 0 β€” First Understand the Problem

If we deploy directly to production:

Developer pushes β†’ users see bugs
Enter fullscreen mode Exit fullscreen mode

That is dangerous.

So DevOps creates safe layers.

Think of it like a hospital:

You don’t send a medicine directly to patients.

You test it first.


πŸ”· ENVIRONMENT 1 β€” DEV

What is DEV?

Dev = playground.

Purpose:

  • Test if image builds
  • Test if container runs
  • Test if Helm works
  • Test if service reachable

This environment is allowed to break.


How GitOps Works in DEV

You create:

manual-app-helm/
    values-dev.yaml
Enter fullscreen mode Exit fullscreen mode

Argo CD Application:

manual-app-dev
Enter fullscreen mode Exit fullscreen mode

Watching:

  • branch: main
  • values-dev.yaml

When Jenkins updates image tag β†’
Argo CD auto deploys to DEV.


Who Uses DEV?

  • Developers
  • DevOps

They check:

  • Does app start?
  • Is port correct?
  • Any crash?
  • Logs OK?

πŸ”· ENVIRONMENT 2 β€” STAGE

What is STAGE?

Stage = rehearsal before production.

It should look like production.

Same:

  • Node size
  • Resources
  • Ingress
  • TLS
  • Scaling

How It Works

You create:

values-stage.yaml
Enter fullscreen mode Exit fullscreen mode

Argo CD Application:

manual-app-stage
Enter fullscreen mode Exit fullscreen mode

Watching:

  • branch: release OR
  • same branch but different values file

What Happens Here?

  • QA team tests
  • Integration tests
  • API tests
  • Performance tests
  • Security scans

If everything passes β†’ ready for production.


πŸ”· ENVIRONMENT 3 β€” PRODUCTION

What is Production?

Real users.
Real traffic.
Real money.

This environment must:

  • Be stable
  • Be secure
  • Be approved

How GitOps Works in Production

Production deployment should NOT be automatic from main branch.

Common strategies:

Strategy 1 β€” Release Branch

main β†’ dev
release β†’ stage
tag v1.0 β†’ production
Enter fullscreen mode Exit fullscreen mode

Only approved code gets merged to release.


Strategy 2 β€” Manual Promotion

You manually change image tag in:

values-prod.yaml
Enter fullscreen mode Exit fullscreen mode

And push commit.

Argo CD deploys.

This creates audit trail.


πŸ”₯ Why This Is Important

Because CI only proves:

βœ” Code compiles
βœ” Docker builds

But it does NOT prove:

βœ” Application logic works
βœ” Database integration works
βœ” External APIs work
βœ” Performance is acceptable

That is why environments exist.


πŸ”· Real GitOps Multi-Env Structure

Your Helm repo could look like this:

manual-app-helm/
   charts/
   values-dev.yaml
   values-stage.yaml
   values-prod.yaml
Enter fullscreen mode Exit fullscreen mode

Argo CD apps:

manual-app-dev
manual-app-stage
manual-app-prod
Enter fullscreen mode Exit fullscreen mode

Each points to:

Same repo
Different values file
Different namespace

Example:

namespace: dev
namespace: stage
namespace: prod
Enter fullscreen mode Exit fullscreen mode

πŸ”· Deployment Flow Explained for Beginners

Let’s imagine version 15.

Step 1 β€” Developer pushes code

CI runs:

docker build
docker push
Enter fullscreen mode Exit fullscreen mode

Tag = 15


Step 2 β€” Jenkins updates values-dev.yaml

Now dev environment runs image 15.

Developers test.


Step 3 β€” Promote to Stage

DevOps changes:

values-stage.yaml β†’ tag 15
Enter fullscreen mode Exit fullscreen mode

Argo CD deploys to stage.

QA tests.


Step 4 β€” Promote to Production

After approval:

values-prod.yaml β†’ tag 15
Enter fullscreen mode Exit fullscreen mode

Argo CD deploys.

Users see new version.


πŸ”₯ Key DevOps Principle

We do not rebuild image for each environment.

We promote the SAME image.

This guarantees:

What was tested = what goes to production
Enter fullscreen mode Exit fullscreen mode

Very important concept.


πŸ”· Interview-Level Explanation

If asked:

Why separate environments?

Answer:

Because CI validates build integrity, but environments validate runtime behavior progressively to reduce production risk.


Simple Analogy

Dev = kitchen test
Stage = restaurant rehearsal
Prod = customers eating

You never experiment directly with customers.

Top comments (0)