add shared resources

This commit is contained in:
Morten Olsen
2025-12-03 20:16:02 +01:00
parent 164570237b
commit e249df8693
8 changed files with 85 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
apiVersion: v2
version: 1.0.0
name: postgres-cluster

View File

@@ -0,0 +1,10 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: "{{ .Release.Name }}"
namespace: "{{ .Release.Namespace }}"
spec:
instances: 1
storage:
storageClass: "{{ .Values.globals.storageClass }}"
size: 2Gi

View File

@@ -0,0 +1 @@
{}

6
shared/root/Chart.yaml Normal file
View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: shared
description: A Helm chart for the shared resources of the homelab
type: application
version: 0.1.0
appVersion: "1.0.0"

View File

@@ -0,0 +1,39 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: shared
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:
timezone: {{ .Values.globals.timezone }}
storageClass: {{ .Values.globals.storageClass }}
destination:
server: https://kubernetes.default.svc
namespace: "{{ .Values.project }}"
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View File

@@ -0,0 +1,17 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: "{{ .Values.project }}"
namespace: argocd
spec:
description: "Project for homelab apps"
sourceRepos:
- "*"
destinations:
- namespace: "{{ .Values.project }}"
server: https://kubernetes.default.svc
- namespace: argocd
server: https://kubernetes.default.svc
clusterResourceWhitelist:
- group: "*"
kind: "*"

8
shared/root/values.yaml Normal file
View File

@@ -0,0 +1,8 @@
repoURL: "https://github.com/morten-olsen/homelab-apps"
targetRevision: "main"
path: "shared/charts"
exclude: "*.disabled"
project: "shared"
globals:
timezone: Europe/Amsterdam
storageClass: prod