{"id":21039510,"url":"https://github.com/selfhostedpro/argo-cd-aoa-boilerplate","last_synced_at":"2025-09-03T12:40:24.588Z","repository":{"id":44884664,"uuid":"417909429","full_name":"SelfhostedPro/argo-cd-aoa-boilerplate","owner":"SelfhostedPro","description":"A template to help get argo-cd up and running in a self managed state with public or private repos.","archived":false,"fork":false,"pushed_at":"2022-03-08T15:39:38.000Z","size":44,"stargazers_count":20,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-22T18:20:20.882Z","etag":null,"topics":["argo-cd","cd","k8s","kubernetes","kubeseal","kustomize","sealed-secrets"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SelfhostedPro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-16T18:08:59.000Z","updated_at":"2023-11-07T22:04:38.000Z","dependencies_parsed_at":"2022-08-28T18:21:52.733Z","dependency_job_id":null,"html_url":"https://github.com/SelfhostedPro/argo-cd-aoa-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfhostedPro%2Fargo-cd-aoa-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfhostedPro%2Fargo-cd-aoa-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfhostedPro%2Fargo-cd-aoa-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfhostedPro%2Fargo-cd-aoa-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SelfhostedPro","download_url":"https://codeload.github.com/SelfhostedPro/argo-cd-aoa-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225362545,"owners_count":17462439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argo-cd","cd","k8s","kubernetes","kubeseal","kustomize","sealed-secrets"],"created_at":"2024-11-19T13:41:59.541Z","updated_at":"2024-11-19T13:41:59.984Z","avatar_url":"https://github.com/SelfhostedPro.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Argo-cd App of Apps Boilerplate\r\n\r\nThis repo is a boilerplate to get argo-cd up and running in a self-managed state quickly and easily with a private github repo. (also works for public repos)\r\n\r\n## Setup\r\n\r\n### Requirments on local machine\r\n\r\n- [kubectl](https://kubernetes.io/docs/tasks/tools/) - Kubernetes cli tool\r\n- [kustomize](https://kustomize.io) - Templating utility for kubernetes manifests\r\n- [kubeseal](https://github.com/bitnami-labs/sealed-secrets#homebrew) - Utility for generating sealed secrets\r\n\r\n### Public Repo Changes Needed:\r\n\r\nWhen using a public repo we're not going to need to setup sealed secrets (At least for the core argo-cd setup). You'll want to make the following changes:\r\n\r\n1. Delete the following files/folders:\r\n   ```bash\r\n   apps/templates/sealed-secrets.yaml\r\n   kustom/sealed-secrets\r\n   kustom/argo-cd/base/argocd-repo-key.yaml\r\n   ```\r\n\r\n2. Then change `apps/kustomization.yaml` and remove the following line:\r\n   ```yaml\r\n   - templates/sealed-secrets.yaml\r\n   ```\r\n\r\n3. Finally change `kustom/argo-cd/kustomization.yaml` and remove the following line:\r\n   ```yaml\r\n   - base/argocd-repo-key.yaml\r\n   ```\r\n  \r\n**End of public repo setup**\r\n\r\n### Deployment\r\n\r\n1. Fork this repository.\r\n2. Change all of the git refrences to match your repository:\r\n\r\n   git urls are located in the following files:\r\n\r\n   ```bash\r\n   apps/templates/*\r\n   kustom/argo-cd/base/argocd-cm\r\n   ```\r\n\r\n3. Spin up a fresh kubernetes cluster and then clone your forked repository to your local machine.\r\n\r\n4. Open a shell in the cloned repo and run the following command to initialize argo-cd:\r\n   ```bash\r\n   kustomize build kustom/argo-cd/ | kubectl apply -n argocd -f -\r\n   ```\r\n\r\n5. Run the following command to get the argo password:\r\n   ```bash\r\n   kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath=\"{.data.password}\" | base64 -d\r\n   ```\r\n   \r\n6. Port forward the webui to your local port 8080:\r\n   ```bash\r\n   kubectl port-forward svc/argocd-server -n argocd 8080:443\r\n   ```\r\n   \r\n7. Open the argo-cd ui, login, and click on the settings cog in the left bar. Add your forked github repo and generate a new ssh key that your're going to be using (make sure you've added it to your github account). Once finished, click on connect.\r\n\r\n8. Now that the repo credentials have been added to argo-cd we're going to add our apps to argo-cd with the following command:\r\n   ```bash\r\n   kustomize build apps/ | kubectl -n argocd apply -f -\r\n   ```\r\n\r\n9. You should see the apps appear in the argo-cd UI.\r\n\r\nThe argo-cd app will encounter a sync error if you're using a private repo, this is normal. We're going to generate a sealed secret in order to give argo-cd access to the repo for that app. (this sealed secret is going to be a private key with read access to our git repo, it's safe to put into the repo because it's been asymmetrically encrypted with a key stored on the kubernetes cluster)\r\n\r\n10. Once the sealed-secrets app is synced you're going to copy the secret that was created when we initially added the repo via the UI above (should be in the argocd namespace with a name similar to\r\n    repo-1340168060). Save this as key.yaml.\r\n    ```\r\n    kubectl get secret -n argocd repo-1340168060 -o yaml \u003e key.yaml\r\n    ```\r\n\r\n11. Run the following command to generate a sealed key and then move it to the right location with the right name:\r\n    ```\r\n    kubeseal --controller-namespace sealed-secrets --format yaml \u003c key.yaml \u003e sealedkey.yaml\r\n    mv sealedkey.yaml kustom/argo-cd/base/argocd-repo-key.yaml\r\n    ```\r\n    \r\n12. Change the name key's value in kustom/argo-cd/base/argocd-repo-key.yaml to argo-github-key\r\n\r\n13. Commit this change and push it to the repo in order for argo to finish the setup for argo-cd to manage the cluster and itself.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfhostedpro%2Fargo-cd-aoa-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfhostedpro%2Fargo-cd-aoa-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfhostedpro%2Fargo-cd-aoa-boilerplate/lists"}