{"id":21009900,"url":"https://github.com/39school/argocd_project_homelab_v2","last_synced_at":"2025-05-15T02:33:41.509Z","repository":{"id":107716328,"uuid":"590497179","full_name":"x86-39/argocd_project_homelab_v2","owner":"x86-39","description":"ArgoCD project deploying GitLab, Jellyfin, Syncthing, Vaultwarden, Joplin and more to my homelab cluster","archived":false,"fork":false,"pushed_at":"2023-03-24T10:14:23.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T10:54:52.443Z","etag":null,"topics":["age","argocd","argocd-applicationsets","argocd-secrets","gitops","k3s","k8s","ksops","kubernetes","sops"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x86-39.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-18T14:54:53.000Z","updated_at":"2023-03-21T20:10:48.000Z","dependencies_parsed_at":"2023-06-08T20:15:45.214Z","dependency_job_id":null,"html_url":"https://github.com/x86-39/argocd_project_homelab_v2","commit_stats":null,"previous_names":["diademiemi/argocd_project_homelab_v2","x86-39/argocd_project_homelab_v2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x86-39%2Fargocd_project_homelab_v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x86-39%2Fargocd_project_homelab_v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x86-39%2Fargocd_project_homelab_v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x86-39%2Fargocd_project_homelab_v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x86-39","download_url":"https://codeload.github.com/x86-39/argocd_project_homelab_v2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225324127,"owners_count":17456474,"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":["age","argocd","argocd-applicationsets","argocd-secrets","gitops","k3s","k8s","ksops","kubernetes","sops"],"created_at":"2024-11-19T09:18:22.182Z","updated_at":"2025-05-15T02:33:35.954Z","avatar_url":"https://github.com/x86-39.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArgoCD resources for my homelab\n\nThis repository is part of my homelab_v2 setup, please check the following repository for more information: https://github.com/diademiemi/homelab_v2  \n\n### [Project Structure](#project-structure)\nThe project is structured with two main directories: `manifests` and `helm`.  These directories contain the manifests and helm charts to be deployed.  \n\nHelm values files and manifest directories are called either `local` or `cloud` to determine which environment they are for.  \n\n\u003cdetails\u003e\u003csummary\u003eDirectory structure\u003c/summary\u003e\n\n```\n├── helm/[1]\n│   ├── namespace/\n│   │   ├── project/\n│   │   │   ├── chart/\n│   │   │   │   ├── Chart.yaml\n│   │   │   │   ├── Chart.lock\n│   │   │   │   ├── values.yaml (optional)\n│   │   │   │   ├── templates/\n│   │   │   ├── values/\n│   │   │   │   ├── local.yaml[2]\n│   │   │   │   ├── cloud.yaml\n├── manifests/[1]\n│   ├── namespace/\n│   │   ├── project/\n│   │   │   ├── prod/[3]\n│   │   │   │   ├── manifest01.yaml\n│   │   │   │   ├── manifest02.yaml\n├── projects/[4]\n│   ├── prod.yaml\n│   ├── stage.yaml (optional)\n│   ├── test.yaml (optional)\n│   ├── dev.yaml (optional)\n```\n[1] The `manifests` and `helm` directories are split into namespaces, projects and environments.  \n[2]  For Helm, the environments are found in the `values` directory. An Application is made when a file called `cloud.yaml`/`local.yaml` (Or other environment) is found in a directory of a project.  \n[3]  For manifests, an Application is made when a directory called `cloud`/`local` (Or other environment) is found in a directory of a project.  \n[4]  The `projects` directory contains the ApplicationSets to deploy the applications.    \n\n\u003c/details\u003e\n\n### [SOPS](#sops)\nSome files in this repository are encrypted with [SOPS](https://github.com/mozilla/sops). They are using the [age](https://github.com/FiloSottile/age) encryption method.  \n\n## [Secrets with Kustomize and SOPS](#sops-kustomize)\nSecrets can be managed with [SOPS](https://github.com/mozilla/sops).  \nThere is a [SOPS plugin for Kustomize](https://github.com/viaduct-ai/kustomize-sops) which makes ArgoCD automatically decrypt the secrets when given a key. You can read more about this in [This Red Hat Article](https://cloud.redhat.com/blog/a-guide-to-gitops-and-secret-management-with-argocd-operator-and-sops)  \n\nTo read more about manifests, see [#manifests](#manifests).\n\n### [Installation on workstation](#installation-on-workstation)\n\nMake sure you have [kustomize](https://kustomize.io/), [sops](https://github.com/mozilla/sops#download) and [age](https://github.com/FiloSottile/age#installation) installed on your machine.  \n\n[Follow the instructions here](https://github.com/viaduct-ai/kustomize-sops#installation) to install the plugin for kustomize on your machine. Set `$XDG_CONFIG_HOME` to `~/.config` if it is not set.  \n\n### [Initialize new SOPS age public/private key](#initialize-sops)\nGenerate a new age keypair.  \n```bash\nage-keygen -o \u003cpath to age private key file\u003e\n```\nThis will return a public key and write the private key to the file. Make sure not to commit the private key to the repository, and keep it safe.  \n\nTo use SOPS in this repository, create a `.sops.yaml` in the root of the repository.  \n```yaml\ncreation_rules:\n  - path_regex: .*\\.sops\\.ya?ml\n    encrypted_regex: \"^(data|stringData)$\"\n    age: \u003cage publickey\u003e\n```\nThis will encrypt the `data` or `stringData` fields in all files ending in `.sops.yaml` or `.sops.yml` with the age public key. You will need the private key to decrypt the secrets.  \n\n### [Add a secret to a project](#add-a-secret-to-a-project)\n\nCreate a `kustomization.yaml` file in the environment directory.  \n```yaml\ngenerators:\n  - ./kustomize-secret-generator.yaml\n```\nCreate a `kustomize-secret-generator.yaml` file in the project/environment directory. Where the `files` key is a list of files to encrypt/decrypt with SOPS.\n```yaml\napiVersion: viaduct.ai/v1\nkind: ksops\nmetadata:\n  # Specify a name\n  name: sops-secret-generator\nfiles:\n  - ./secret-manifest.sops.yaml\n```\n\n### [Encrypt/Decrypt secrets](#encryptdecrypt-secrets)\n\nEncrypt the secret manifest file with SOPS. This will use the age public key in the `.sops.yaml` file.  \n```bash\nsops --encrypt --in-place ./secret-manifest.sops.yaml\n```\n\nDecrypt the secret manifest file with SOPS.  \n```bash\nexport SOPS_AGE_KEY_FILE=\u003cpath to age private key file\u003e \nsops --decrypt --in-place ./secret-manifest.sops.yaml\n```\n\n***Make sure to encrypt any secrets before committing them to a repository!***   \n\n## [Manifests](#manifests)\nManifests are stored in the `manifests` directory.  They are processed as follows:\n\n\u003cdetails\u003e\u003csummary\u003eDirectory structure\u003c/summary\u003e\n\n\n```\nmanifests/cert-manager/deploy/cloud/manifest.yaml\n│         │       │      │    │\n│         │       │      │    └─── manifest file\n│         │       │      └──────── environment\n│         │       └─────────────── project\n│         └─────────────────────── namespace\n└───────────────────────────────── root\n```\n\n\u003c/details\u003e\n\nKustomize may also be used if a `kustomization.yaml` file is present in the environment directory. Be aware that this will cause Kustomize to manage the entire directory, so any manifests not configured in the `kustomization.yaml` will be ignored.  \n\n## [Helm](#helm)\nHelm charts are stored in the `helm` directory.  They are processed as follows:\n\n\u003cdetails\u003e\u003csummary\u003eDirectory structure\u003c/summary\u003e\n\n```\nhelm/cert-manager/deploy/chart/Chart.yaml\n│    │       │              │     │\n│    │       │              │     └─── helm chart file\n│    │       │              └───────── chart directory\n│    │       └──────────────────────── project\n│    └──────────────────────────────── namespace\n└───────────────────────────────────── root\nhelm/cert-manager/deploy/values/cloud.yaml\n│    │       │      │      │\n│    │       │      │      └─── values file\n│    │       │      └────────── environment\n│    │       └───────────────── project\n│    └───────────────────────── namespace\n└────────────────────────────── root\n```\n\n\u003c/details\u003e\n\nTo use external helm charts, add them under `dependencies` in the `Chart.yaml` file. The `Chart.yaml` must still be a valid helm chart, so you will need to pass values like `apiVersion`, `name`, `description` and `version`.  \nThis will include the helm chart as a subchart in the chart. Be aware that values for the subchart will need to be scoped to the subchart. For example, for cert-manager, the usual values would be:  \n```yaml\ninstallCRDs: true\n```\nBut when it is included as a subchart called `cert-manager`, the values would be:\n```yaml\ncert-manager:\n  installCRDs: true\n```\nYou can find more information about this in the [Helm documentation](https://helm.sh/docs/chart_template_guide/subcharts_and_globals/).  \n\n## [Projects](#projects)\nProjects are stored in the `projects` directory.  They are processed as follows:\n\n\u003cdetails\u003e\u003csummary\u003eDirectory structure\u003c/summary\u003e\n\n```\nprojects/cloud.yaml\n│        │\n│        └─── project file of this environment\n└──────────── root\n```\nThe ApplicationSets in this file will traverse the `manifests` and `helm` directories and search for files matching `values/cloud.yaml` and manifests with a `cloud/` directory. Application objects will be created using a combination of the namespace, project and environment retrieved from these filenames.  \nFor more information, read through [the ApplicationSet documentation](https://argo-cd.readthedocs.io/en/stable/user-guide/application-set/) and the [cloud.yaml](projects/cloud.yaml) file.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F39school%2Fargocd_project_homelab_v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F39school%2Fargocd_project_homelab_v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F39school%2Fargocd_project_homelab_v2/lists"}