mirror of
https://github.com/morten-olsen/homelab-apps.git
synced 2026-02-08 01:36:28 +01:00
6
charts/argocd-apps/Chart.yaml
Normal file
6
charts/argocd-apps/Chart.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: argocd-apps
|
||||
description: A Helm chart for ArgoCD ApplicationSet to deploy homelab apps
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0.0"
|
||||
60
charts/argocd-apps/README.md
Normal file
60
charts/argocd-apps/README.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# ArgoCD Apps
|
||||
|
||||
This Helm chart deploys an ArgoCD ApplicationSet and AppProject to manage homelab applications.
|
||||
|
||||
## Description
|
||||
|
||||
It sets up:
|
||||
- **AppProject**: A project named `apps` (configurable) to group the applications.
|
||||
- **ApplicationSet**: Automatically discovers and deploys Helm charts from `charts/apps/*` in the repository.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes cluster
|
||||
- ArgoCD installed in the `argocd` namespace
|
||||
|
||||
## Deployment
|
||||
|
||||
### Option 1: Helm Install
|
||||
|
||||
Run the following command to install the chart directly:
|
||||
|
||||
```bash
|
||||
helm upgrade --install argocd-apps ./charts/argocd-apps \
|
||||
--namespace argocd
|
||||
```
|
||||
|
||||
### Option 2: ArgoCD App of Apps
|
||||
|
||||
You can also deploy this chart using ArgoCD itself by creating an Application that points to this chart.
|
||||
|
||||
```yaml
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: argocd-apps
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: https://github.com/morten-olsen/homelab-apps
|
||||
targetRevision: main
|
||||
path: charts/argocd-apps
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: argocd
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|-----------|-------------|---------|
|
||||
| `repoURL` | URL of the git repository | `https://github.com/morten-olsen/homelab-apps` |
|
||||
| `targetRevision` | Git revision to use | `main` |
|
||||
| `path` | Path to the apps directory | `charts/apps` |
|
||||
| `exclude` | Pattern to exclude directories | `*.disabled` |
|
||||
| `project` | ArgoCD project name | `apps` |
|
||||
40
charts/argocd-apps/templates/applicationset.yaml
Normal file
40
charts/argocd-apps/templates/applicationset.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
name: homelab-apps
|
||||
namespace: argocd
|
||||
spec:
|
||||
generators:
|
||||
- git:
|
||||
repoURL: {{ .Values.repoURL }}
|
||||
revision: {{ .Values.targetRevision }}
|
||||
directories:
|
||||
- path: {{ .Values.path }}/*
|
||||
- path: {{ .Values.path }}/*{{ .Values.exclude }}
|
||||
exclude: true
|
||||
template:
|
||||
metadata:
|
||||
name: '{{`{{path.basename}}`}}'
|
||||
spec:
|
||||
project: {{ .Values.project }}
|
||||
source:
|
||||
repoURL: {{ .Values.repoURL }}
|
||||
targetRevision: {{ .Values.targetRevision }}
|
||||
path: '{{`{{path}}`}}'
|
||||
helm:
|
||||
valueFiles:
|
||||
- values.yaml
|
||||
values: |
|
||||
globals:
|
||||
environment: {{ .Values.globals.environment }}
|
||||
domain: {{ .Values.globals.domain }}
|
||||
timezone: {{ .Values.globals.timezone }}
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: prod
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
15
charts/argocd-apps/templates/project.yaml
Normal file
15
charts/argocd-apps/templates/project.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: AppProject
|
||||
metadata:
|
||||
name: {{ .Values.project }}
|
||||
namespace: argocd
|
||||
spec:
|
||||
description: "Project for homelab apps"
|
||||
sourceRepos:
|
||||
- '*'
|
||||
destinations:
|
||||
- namespace: prod
|
||||
server: https://kubernetes.default.svc
|
||||
clusterResourceWhitelist:
|
||||
- group: '*'
|
||||
kind: '*'
|
||||
9
charts/argocd-apps/values.yaml
Normal file
9
charts/argocd-apps/values.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
repoURL: "https://github.com/morten-olsen/homelab-apps"
|
||||
targetRevision: "argo"
|
||||
path: "charts/apps"
|
||||
exclude: "*.disabled"
|
||||
project: "apps"
|
||||
globals:
|
||||
environment: prod
|
||||
domain: olsen.cloud
|
||||
timezone: Europe/Amsterdam
|
||||
Reference in New Issue
Block a user