⚡ ~/naveed Interview Prep
⚡ Portfolio Home ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All Platform Engineering & IDP Interview Questions Scenario 38 of 50 in Platform Engineering & IDP
Senior Platform Engineer Platform Engineering GitOps & Delivery Workflows GitOps Contention
🎯 Target Role / Context: Senior Platform Engineer Interview · GitOps Architecture Track

Q: Your company uses a central GitOps repository where ArgoCD monitors application manifests. When 60 developers open PRs simultaneously, ephemeral environment commits cause constant git merge conflicts and rebase failures in the central GitOps repo. How do you architect GitOps for ephemeral environments without repository contention?

Managing high-velocity ephemeral environment GitOps states without git merge conflicts across 100+ active pull request branches.

#Platform Engineering #GitOps #ArgoCD #Monorepo #GitHub Actions #Ephemeral Environments
🎙️ Candidate Opening & Architectural Context
"Writing ephemeral PR branch manifests back into a single shared GitOps repository's main branch creates extreme git lock contention. Solutions involve using dynamic branch generators in ArgoCD ApplicationSets, or decoupling ephemeral environments into separate Git repositories or in-cluster Helm releases."
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

1

Use ArgoCD Pull Request Generator Directly Against Source Repos

Instead of committing preview manifests into a shared config repository, configure ArgoCD's `PullRequest` generator directly targeting the application source repository.

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: ephemeral-preview-apps
spec:
  generators:
    - pullRequest:
        github:
          owner: acme-corp
          repo: checkout-service
          labels: ["preview"]
  template:
    metadata:
      name: 'checkout-pr-{{number}}'
    spec:
      source:
        repoURL: 'https://github.com/acme-corp/checkout-service.git'
        targetRevision: '{{head_sha}}'
        path: ./deploy/helm
      destination:
        namespace: 'pr-{{number}}'
        server: 'https://kubernetes.default.svc'
2

Filter Ephemeral Environments with GitHub PR Labels

Only spin up preview environments when developers add a specific label (e.g. `preview`). This prevents spinning up clusters for minor documentation typo fixes.

Pro Tip: Concurrency Relief: The PullRequest generator queries the GitHub API directly. No commits are made to a central git repository, eliminating 100% of git merge conflicts.
Advertisement
3

Automated Environment Teardown on PR Merge

When the PR closes or merges, the ApplicationSet controller automatically detects the closed PR state and cleanly deletes the associated ArgoCD Application and Kubernetes namespace.

Pro Tip: Architecture Pattern: Keep permanent environments in GitOps config repos; manage ephemeral preview environments via dynamic Git provider API generators.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Eliminate GitOps monorepo merge contention by using ArgoCD ApplicationSet PullRequest generators that read manifests directly from application PR branches."
⚡ 60-Second Elevator Pitch Talking Points
  • Use ArgoCD ApplicationSet pullRequest generators instead of committing preview manifests to central repos.
  • Trigger ephemeral preview environments conditionally using GitHub PR labels (e.g. 'preview').
  • Rely on the ApplicationSet controller to automatically destroy ephemeral environments upon PR closure.
Advertisement
Want more Platform Engineering & IDP scenarios?
Explore our complete collection of scenario-based Platform Engineering & IDP interview runbooks.
Browse All Platform Engineering & IDP Questions →