Skip to main content

Web interface and CLI


Table of Contents

  1. Web interface
  2. argocd CLI
  3. Essential commands
  4. Notifications
  5. Hands-on exercises

1 - Web interface

Access

# Port-forward
kubectl port-forward svc/argocd-server -n argocd 8080:443

# Ouvrir https://localhost:8080
# Login: admin / <password>

Main pages

PageDescription
ApplicationsList of all apps
SettingsConfiguration, repos, clusters
User InfoProfile and tokens

Application view

The interface displays:

  • Sync Status: Synced, OutOfSync
  • Health Status: Healthy, Degraded, Progressing
  • Resource Tree: Hierarchy of K8s resources
  • Diff: Differences between Git and cluster

Available actions

ActionDescription
SYNCSynchronize with Git
REFRESHReload from Git
ROLLBACKReturn to a version
DELETEDelete the application
# Filtrer par projet
project:production

# Filtrer par status
status:OutOfSync

# Filtrer par label
label:team=backend

🔝 Back to table of contents


2 - argocd CLI

Installation

# macOS
brew install argocd

# Linux
VERSION=$(curl -s https://api.github.com/repos/argoproj/argo-cd/releases/latest | grep tag_name | cut -d '"' -f 4)
curl -sSL -o argocd https://github.com/argoproj/argo-cd/releases/download/$VERSION/argocd-linux-amd64
sudo install -m 555 argocd /usr/local/bin/argocd

# Windows
choco install argocd-cli

Connection

# Login interactif
argocd login localhost:8080

# Login avec credentials
argocd login localhost:8080 \
--username admin \
--password <password> \
--insecure

# Login avec token
argocd login localhost:8080 \
--auth-token <token>

# Vérifier
argocd version

Configuration

# Voir le contexte actuel
argocd context

# Lister les contextes
argocd context

# Changer de contexte
argocd context my-argocd-server

🔝 Back to table of contents


3 - Essential commands

Applications

# Lister
argocd app list

# Créer
argocd app create my-app \
--repo https://github.com/org/repo.git \
--path apps/my-app \
--dest-server https://kubernetes.default.svc \
--dest-namespace default

# Détail
argocd app get my-app

# Synchroniser
argocd app sync my-app

# Synchroniser avec options
argocd app sync my-app --prune --force

# Historique
argocd app history my-app

# Rollback
argocd app rollback my-app 3

# Supprimer
argocd app delete my-app

# Supprimer avec les ressources
argocd app delete my-app --cascade

Repositories

# Lister
argocd repo list

# Ajouter (HTTPS)
argocd repo add https://github.com/org/repo.git \
--username git \
--password <token>

# Ajouter (SSH)
argocd repo add [email protected]:org/repo.git \
--ssh-private-key-path ~/.ssh/id_rsa

# Supprimer
argocd repo rm https://github.com/org/repo.git

Clusters

# Lister
argocd cluster list

# Ajouter
argocd cluster add my-cluster-context

# Supprimer
argocd cluster rm https://my-cluster.example.com

Projects

# Lister
argocd proj list

# Créer
argocd proj create production \
--dest https://kubernetes.default.svc,production \
--src https://github.com/org/gitops.git

# Détail
argocd proj get production

Accounts

# Lister les comptes
argocd account list

# Changer le mot de passe
argocd account update-password

# Générer un token
argocd account generate-token --account admin

🔝 Back to table of contents


4 - Notifications

Installation

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/stable/manifests/install.yaml

Slack configuration

apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
namespace: argocd
data:
service.slack: |
token: $slack-token

template.app-deployed: |
message: |
Application {{.app.metadata.name}} has been deployed.
Sync Status: {{.app.status.sync.status}}
Health Status: {{.app.status.health.status}}

trigger.on-deployed: |
- when: app.status.sync.status == 'Synced'
send: [app-deployed]

Annotate an application

metadata:
annotations:
notifications.argoproj.io/subscribe.on-deployed.slack: my-channel

Available triggers

TriggerDescription
on-deployedAfter successful sync
on-health-degradedHealth degraded
on-sync-failedSync failure
on-sync-runningSync in progress
on-sync-status-unknownUnknown status

🔝 Back to table of contents


5 - Hands-on exercises

Exercise 1: Complete CLI workflow

# 1. Se connecter
argocd login localhost:8080 --username admin --password <password>

# 2. Créer une application
argocd app create demo \
--repo https://github.com/argoproj/argocd-example-apps.git \
--path guestbook \
--dest-server https://kubernetes.default.svc \
--dest-namespace demo

# 3. Vérifier le status
argocd app get demo

# 4. Synchroniser
argocd app sync demo

# 5. Voir l'historique
argocd app history demo

# 6. Voir les ressources
argocd app resources demo

# 7. Supprimer
argocd app delete demo

Exercise 2: Explore the UI

  1. Open the UI and create an application via the form
  2. Observe the Resource Tree
  3. Click on a pod and view the logs
  4. Do a Diff to see the differences
  5. Do a Rollback to a previous version

Quiz

Q1. How do you see the differences between Git and the cluster?

Answer

Via the UI: Click on the application then on "DIFF" or "APP DIFF"

Via the CLI:

argocd app diff my-app

Q2. How do you perform a rollback?

Answer
# Voir l'historique
argocd app history my-app

# Rollback à la révision 3
argocd app rollback my-app 3

Or via the UI: History → select a version → Rollback

🔝 Back to table of contents


Key takeaways

  • UI: Visualization, monitoring, quick actions
  • CLI: Automation, scripts, CI/CD
  • Key commands: app create, app sync, app get
  • Notifications: Slack, Teams, email
  • The UI displays the Resource Tree to visualize dependencies

← Previous chapter | Next chapter: ApplicationSets →