On Jenkins, e.g., you would have to configure kubectl and credentials to allow to do a kubectl apply on a k8s cluster. That is a ginormous work, and may result in security holes. That way, you would also have to think on how to make Jenkins understand the deploy ran successfully on the cluster.
ArgoCD is installed on the cluster. ArgoCD is installed on the cluster, listens to a github repository, and when a change occurs, it applies it to the cluster (this is the “gitops” concept).
Application code and configuration as a best practice should be on separate repositories.
ArgoCD supports k8s yaml files, helm charts, kustomize and template files that generate k8s manifests.
ArgoCD allows separation from the CI and CD pipelines. The CI pipeline can build an image, upload it to a registry and update a k8s manifest file on a gitops repo. That way, ArgoCD can detect the gitops repo change and trigger the CD pipeline.
Whatever is done manually on kubectl gets reverted, since the git repository Argo listens is the single source of truth. ALTHOUGH you can configure ArgoCD to not override manual changes, but to send an alert and stay out-of-sync until the manual changes are applied to the gitops repository.
Benefits:
ArgoCD is deployed on the cluster.
ArgoCD is configured on the cluster with k8s YAML file.
You can group applications into “AppProjects”.
TODO: Ver o conceito de “CRD” no k8s (ArgoCD is installed as a CRD on the cluster)
1 ArgoCD instance is able to sync more than one (a “fleet”) of k8s clusters
Best practice to work with multiple clusters:
1 Git repository,
do not deploy to all environments at once (1st development, then staging, then production). How?
ArgoCD is specific for k8s. You will need a CI tool, and another CD tool if you are not on k8s.
(this video has a practical HOWTO on how to install and configure ArgoCD)
ArgoCD features that are not enabled by default (probably as a safety measure):
application.yaml
, which has the ArgoCD configuration, under the section “syncPolicy”By default, ArgoCD will poll the git repository every 3 minutes for changes. If you want it sooner, you can configure a git webhook.