Add ArgoCD Deployment for GitOps Workflow #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This PR is regarding the issue #45. In this PR, argocd application is created using app of apps pattern for self managing argocd in a declarative gitops way. There is also folder structure setup in-place so that future additions of argocd applications will be easier. README.md file is added for documentation which details the creation of argocd deployment manually for initial setup and then switching to gitops self-managed method.
Directory structure:
Why?
This PR addresses the issue #45. Changes are done to enable gitops workflow using argocd. App of apps pattern becomes necessary because without it, the changes to argocd-app.yaml needs to be applied imperatively using kubectl command as the argocd-app.yaml uses helm chart of argocd to deploy it.
How?
This uses app of apps pattern for self managing argocd. We first set it up manually for initial setup and then switch to declarative gitops way to manage argocd.
Testing
Make sure kubectl, argocd cli, k8s cluster with atleast 3 worker nodes and helm cli are installed.
Quote from artifacthub
Execute commands from the
How?
section above. Then proceed to step 1.Get password for ui server
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
kubectl port-forward service/argo-cd-argocd-server -n argocd 8080:443
. Access the page at http://127.0.0.1:8080argocd login localhost:8080
argocd app list
helm list -n argocd
will no longer show the original release it created.Make a change to the
targetRevision
version specified in argocd-app.yaml and commit to github. Argocd will automatically synchronize the change. UI server will be down briefly. Re-run port forward command again to access the UI page.Screenshot:
Something similar should be seen:
Anything else?
Found this while researching but need to explore further: https://github.com/argoproj-labs/argocd-autopilot
Found a two stage approach implemented here: https://github.com/axivo/k3s-cluster
Chatgpt summary: