DEV Community

Alex Spinov
Alex Spinov

Posted on

Argo CD Has a Free API: GitOps Continuous Delivery for Kubernetes

Argo CD is a GitOps continuous delivery tool for Kubernetes. It watches your Git repos and automatically syncs your cluster state to match. It has a full REST API, CLI, web UI, and SSO integration.

Why Argo CD?

  • GitOps — Git is the source of truth for cluster state
  • Declarative — describe desired state, Argo CD reconciles
  • Multi-cluster — manage multiple K8s clusters from one instance
  • Full API — REST + gRPC for automation
  • Web UI — visual app topology, sync status, health

Install

# Install to Kubernetes
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

# CLI
brew install argocd

# Login
argocd admin initial-password -n argocd
argocd login localhost:8080
Enter fullscreen mode Exit fullscreen mode

Create Application (CLI)

argocd app create my-app \
  --repo https://github.com/myorg/my-app.git \
  --path k8s/ \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace default \
  --sync-policy automated \
  --auto-prune \
  --self-heal

# Sync manually
argocd app sync my-app

# Get status
argocd app get my-app

# List apps
argocd app list

# View diff (what will change)
argocd app diff my-app

# History
argocd app history my-app

# Rollback
argocd app rollback my-app 2
Enter fullscreen mode Exit fullscreen mode

Application Manifest

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/myorg/my-app.git
    targetRevision: HEAD
    path: k8s/
  destination:
    server: https://kubernetes.default.svc
    namespace: default
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
Enter fullscreen mode Exit fullscreen mode

REST API

BASE="https://argocd.example.com/api/v1"
TOKEN="your-token"

# List applications
curl "$BASE/applications" -H "Authorization: Bearer $TOKEN"

# Get application
curl "$BASE/applications/my-app" -H "Authorization: Bearer $TOKEN"

# Sync application
curl -X POST "$BASE/applications/my-app/sync" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"prune": true}'

# Get app resources
curl "$BASE/applications/my-app/resource-tree" \
  -H "Authorization: Bearer $TOKEN"

# App health
curl "$BASE/applications/my-app" \
  -H "Authorization: Bearer $TOKEN" | jq '.status.health.status'
Enter fullscreen mode Exit fullscreen mode

Key Features

Feature Details
Source Git, Helm, Kustomize, plain YAML
Sync Automated or manual
Self-heal Auto-revert manual cluster changes
Multi-cluster Manage N clusters
SSO OIDC, LDAP, GitHub, GitLab
RBAC Fine-grained access control
Notifications Slack, Teams, email, webhook

Resources


Need Kubernetes tooling? Check my Apify actors or email spinov001@gmail.com.

Top comments (0)