GitOps with Argo CD
Codewise can generate and apply an Argo CD Application that points at a Git repository. Argo CD then reconciles the desired state.
Requirements
- Argo CD installed in the cluster
- Permission to create Applications in the
argocdnamespace - A repository containing Kubernetes manifests, a Kustomize overlay, or a Helm chart
- Repository credentials configured in Argo CD when the repository is private
Configure an environment
Create an environment and update its gitops.yaml:
yaml
repo: https://github.com/your-org/deployments
path: environments/staging
branch: mainSet the target namespace and context in k8s.yaml:
yaml
namespace: staging
context: test-clusterPlan first
bash
codewise deploy plan --env stagingGitOps takes priority over Helm and raw-manifest strategies when repo is configured.
Safe preview
bash
codewise deploy run --env staging --dry-runThis renders the Argo CD Application without contacting the cluster or creating a namespace.
Deploy
bash
kubectl config current-context
codewise deploy run --env stagingThe generated Application enables automated synchronization, pruning, self-healing, and namespace creation.
Rollback behavior
For GitOps deployments, prefer reverting the desired-state commit in Git. Helm revision rollback commands are intended for Helm-managed releases.
