Refresh a repo (The YAML manifest in ArgoCD will be compared to the YAML in the version control system (such as GitHub) and if any differences are detected the YAML manifest in ArgoCD will be updated to match the YAML in the version control system (such as GitHub))
Hard Refresh a repo (YAML manifests in ArgoCD are cached - A hard refresh invalidates the cache which forces the YAML manifests in ArgoCD to match the YAML in the version control system (such as GitHub))
The argocd app list command can then be used to list the app you have created.
~]$ argocd app list
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH SYNCPOLICY CONDITIONS REPO PATH TARGET
openshift-gitops/demo https://kubernetes.default.svc default default OutOfSync Missing Manual <none> https://github.com/my_project/my_repo.git python
Notice in this example that the app is OutOfSync. The argocd app sync command can be used to attempt to sync the app.
~]$ argocd app sync openshift-gitops/demo
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2024-12-19T20:42:14-06:00 apps Deployment default python OutOfSync Missing
2024-12-19T20:42:14-06:00 apps Deployment default python OutOfSync Missing deployments.apps is forbidden: User "system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller" cannot create resource "deployments" in API group "apps" in the namespace "default"
Name: openshift-gitops/demo
Project: default
Server: https://kubernetes.default.svc
Namespace: default
URL: https://openshift-gitops-server-openshift-gitops.apps.openshift.example.com/applications/openshift-gitops/demo
Source:
- Repo: https://github.com/my_project/my_repo.git
Target:
Path: python
SyncWindow: Sync Allowed
Sync Policy: Manual
Sync Status: OutOfSync from (dbc57d6)
Health Status: Missing
Operation: Sync
Sync Revision: dbc57d62045ddae6c68f925b7cb3f6a1f621bd81
Phase: Failed
Start: 2024-12-19 20:42:14 -0600 CST
Finished: 2024-12-19 20:42:14 -0600 CST
Duration: 0s
Message: one or more objects failed to apply, reason: deployments.apps is forbidden: User "system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller" cannot create resource "deployments" in API group "apps" in the namespace "default"
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
apps Deployment default python OutOfSync Missing deployments.apps is forbidden: User "system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller" cannot create resource "deployments" in API group "apps" in the namespace "default"
FATA[0000] Operation has completed with phase: Failed
As a default safety feature, automated sync in ArgoCD doesn't delete resources that have been removed from the Git repository. These resources then need to be pruned. The --prune flag can be used if you want to also prune which will remove resources that no longer exist in the git repo.