Is My CI/CD Setup with Dev, Stage, and Prod Branches Logical?

0
9
Asked By CreativeCoder42 On

I'm working on a CI/CD setup that involves three environments: development (dev), staging (stage), and production (prod). In Git, I have a main branch for production, along with stage and dev branches for their respective environments. The workflow starts with creating a feature branch from main, such as feature/test. After development, I push my changes, create a pull request (PR), and then merge into the target branch. For each branch, images are built and pushed to the GitHub registry with a prefixed naming convention: dev-servicename:commithash for dev, stage-servicename:commithash for stage, and no prefix for the main branch. Additionally, I have a separate repository for Kubernetes manifests organized into folders for each environment. ArgoCD manages the updates to the cluster. Does this structure make sense for handling multiple environments and facilitating automated deployments? I'd appreciate any suggestions for improvement!

5 Answers

Answered By CloudyWithAChance On

Your setup sounds solid and is quite commonly used. While I prefer Flux for similar tasks, using ArgoCD is perfectly fine. Go ahead with it!

Answered By DevOpsDynamo On

Your setup looks robust, but debugging environment-specific issues can become a hassle. You might want to explore tools like runnable.io for spinning up isolated runs when bugs pop up.

Answered By BranchingGuru On

I keep infrastructure in its own repository, and all changes go directly into the main branch. In my experience, long-lived branches can get tricky, but that's just my perspective!

Answered By WorkflowWhiz On

Nice work with the mindset you have! I'd suggest starting feature branches from main and merging PRs back into it, which would trigger your CI/CD for dev first and then automating promotions. A streamlined tagging scheme can also save you a lot of headaches later, reducing unnecessary rebuilds!

Answered By K8sWizard On

You might consider maintaining separate repositories for each environment that sync with ArgoCD. Creating your own umbrella helm charts in a different repository can help manage versioned packages effectively. This way, you detach your infrastructure, configurations, charts, and images for each cluster/environment flexibly, possibly using semver tagging for tracking overall cluster versions.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.