
It is 2 a.m. and a production server is misbehaving. Someone logs in over SSH, tweaks a config file, restarts a service, and the alerts go quiet. Everyone goes back to sleep. Nobody writes down what was changed.
Six weeks later a routine deployment quietly overwrites that fix, the problem returns, and nobody can remember why the server ever worked. Meanwhile staging looks nothing like production, and rebuilding the machine from scratch would be an archaeology project.
If any of that feels familiar, GitOps is the habit that fixes it. In this guide we will look at how GitOps infrastructure management works on real production servers, how Argo CD and Flux compare, and how to roll it out without scaring your team.
What GitOps actually is
GitOps means Git is the single source of truth for how your systems should look. Instead of running commands against servers, you change files in a repository, and software makes the servers match. The OpenGitOps principles boil it down to four ideas:
- Declarative: you describe the desired state, not the steps to get there.
- Versioned and immutable: the desired state lives in Git, with full history.
- Pulled automatically: an agent fetches that state rather than waiting for someone to push it.
- Continuously reconciled: the agent keeps checking and corrects drift.
That is declarative infrastructure in practice. Your repository stops being documentation that drifts out of date and becomes the thing that actually runs.
Why it suits production servers
- An audit trail for free. Every change has an author, a reviewer, a timestamp and a reason in the commit history.
- Rollback is a revert. Undoing a bad change means reverting a commit, not remembering what you typed last Tuesday.
- Drift gets corrected. A manual edit on a server is detected and either flagged or reverted.
- Recovery is faster. If a machine or cluster dies, you rebuild from the repository instead of from memory.
- Safer access. Fewer people need standing production credentials when changes flow through reviewed pull requests.
Pull beats push, and here is why
In a traditional pipeline, your CI system holds credentials to production and pushes changes in. That makes the CI server a high-value target. In a pull-based Git-based deployment, an agent running inside your environment reads the repository and applies changes itself, so production credentials never leave the environment. It is a quieter, safer shape for production.
Argo CD and Flux, side by side
Both tools are Kubernetes-focused, both are graduated CNCF projects, and both implement the same core loop. The differences are about style:
| Area | Argo CD | Flux CD |
|---|---|---|
| Interface | Rich web UI showing app health, sync state and diffs | Mostly CLI and Kubernetes resources, with optional UIs |
| Architecture | Central application controller managing Application resources | Modular set of controllers (source, kustomize, helm, notification) |
| Managing many apps or clusters | ApplicationSets generate apps from templates | Kustomizations and HelmReleases per cluster or tenant |
| Image update automation | Usually an add-on such as Argo CD Image Updater | Built-in image automation controllers |
| Secrets in Git | Works with Sealed Secrets, External Secrets or plugins | Native SOPS decryption, plus the same external options |
| Feel | Visual, great for teams who like dashboards | Lean and composable, great for teams who live in the terminal |
Honestly, you cannot go badly wrong with either. Choose Argo CD if your team values a visual overview and easy onboarding. Choose Flux if you prefer a lightweight, toolkit-style approach. Pick one and commit, because running both in the same cluster mostly creates confusion.
Where to host Argo CD or Flux
Search for Argo CD hosting and you will find plenty of managed options. Many teams still prefer running it themselves, since the GitOps controller holds the keys to production and you may want it inside your own network.
- Cluster: a lightweight distribution such as k3s runs nicely on a single dedicated server and scales out to three or more nodes for high availability.
- Controller placement: one controller per cluster is simplest. A separate management cluster that deploys to others adds control but also adds a critical dependency.
- Resources: Flux is light. Argo CD’s repo server can use real memory when rendering large Helm charts or Kustomize overlays, so give it room.
- Git hosting: use a hosted platform or run your own. If you self-host Git and runners, our guide to dedicated servers for CI/CD pipelines covers the sizing.
- Access: put the Argo CD UI behind SSO and a reverse proxy. Our comparison of Nginx, Caddy and Traefik helps you choose.
Dedicated hardware gives predictable performance for the cluster underneath. BeStarHost offers servers in locations like Germany, the United States and Singapore, and an unmanaged server gives you the root access a Kubernetes install needs.
What about servers that are not Kubernetes?
Not everything runs in containers, and that is fine. The same principle works with automated server configuration: keep playbooks in Git and have each server pull and apply them on a schedule using ansible-pull. You get the same audit trail and drift correction without a cluster.
Structure your repository for sanity
- Separate app code from deployment config. A config repo changes for different reasons than a code repo, and it keeps pipelines simple.
- Use folders, not branches, for environments. Directories such as
base/,staging/andproduction/with Kustomize overlays are easier to diff than long-lived branches. - Promote with pull requests. Moving a version from staging to production is a reviewed change to a file.
- Protect the main branch. Require reviews and passing checks. Signed commits are a good extra.
Secrets: the one thing that must not go in plain text
Git history is forever, so a leaked secret stays leaked. Pick one approach early. Sealed Secrets encrypts values so only your cluster can decrypt them. SOPS encrypts files in the repo with keys you control. External Secrets Operator keeps the secrets in a dedicated vault and syncs references. For a broader credential mindset, see our piece on securing tools, credentials and sandboxes.
Safety rails for production
- Start with manual sync in production. Let staging auto-sync, and add approval or automation for production once you trust the flow.
- Treat pruning with respect. Automatic deletion of removed resources is powerful. Test it in staging first.
- Use health checks and notifications. A failed sync should reach a human immediately.
- Watch the pipeline itself. Alert on sync failures and drift. Our guide to OpenTelemetry hosting and distributed tracing helps you see what happens after a deployment lands.
A rollout that will not overwhelm anyone
- Pick one low-risk app in a non-production environment.
- Install Argo CD or Flux and point it at a small config repo.
- Move that app’s manifests into Git and let the tool own it.
- Turn on drift detection and watch what it finds. The results are often eye-opening.
- Add secrets handling and branch protection before adding more apps.
- Promote to production app by app, running a rebuild-from-Git drill once things settle.
Mistakes to avoid
- Keeping plain secrets in the repository.
- Allowing manual
kubectl editchanges “just this once” and then not checking drift. - One giant repo that every team fights over.
- Auto-syncing production before the team trusts the process.
- Skipping backups because “everything is in Git.”
- Never testing a full rebuild.
Frequently asked questions
Is GitOps only for Kubernetes?
The best-known tools target Kubernetes, but the idea of declarative state in Git plus automatic reconciliation also works for traditional servers, for example with ansible-pull.
Which is better, Argo CD or Flux CD?
Neither wins everywhere. Argo CD shines with its UI, Flux with its lean modular design. Choose by team habits rather than feature checklists.
Does GitOps replace CI?
No. CI still builds and tests your code and produces artifacts. GitOps handles how those artifacts reach your servers.
Planning a GitOps platform?
Tell us how many clusters and apps you expect, and we will help you pick server hardware to match. Contact the BeStarHost team or browse our dedicated server plans.
Final thoughts
Good GitOps hosting is less about tools and more about discipline: describe your systems in Git, let an agent do the applying, protect your secrets, and keep real backups. Whether you pick Argo CD or Flux, the payoff is the same. Changes become boring, reviewable and reversible, and the 2 a.m. mystery edit turns into a pull request that anyone can read.
