kustomize + helm now managed by argocd

This commit is contained in:
Remy Moll 2023-11-14 10:09:36 +01:00
parent d217b162ff
commit 73630c45da
10 changed files with 90 additions and 6 deletions

View File

@ -2,7 +2,6 @@ apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: homeassistant-ingress
namespace: homeassistant
spec:
entryPoints:
- websecure
@ -22,7 +21,6 @@ apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: homeassistant-websocket
namespace: homeassistant
spec:
headers:
customRequestHeaders:

View File

@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ingress.yaml
- pvc.yaml
namespace: homeassistant
helmCharts:
- name: home-assistant
releaseName: homeassistant
# namespace: rmoll-harbor-poc
version: 13.4.2
valuesFile: values.yaml
repo: https://k8s-at-home.com/charts/

View File

@ -2,7 +2,6 @@
apiVersion: v1
kind: PersistentVolume
metadata:
namespace: homeassistant
name: homeassistant-nfs
labels:
directory: homeassistant
@ -20,7 +19,6 @@ spec:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: homeassistant
name: homeassistant-nfs
spec:
storageClassName: slow

View File

@ -0,0 +1,3 @@
- op: add
path: /data/kustomize.buildOptions
value: --enable-helm

View File

@ -8,7 +8,15 @@ resources:
- ingress.yaml
- argo-apps.application.yaml
### apply patches from file
patchesStrategicMerge:
- known-hosts.configmap.yaml
## patch to add entries from argocd.configmap.yaml to the configmap
patches:
- target:
kind: ConfigMap
name: argocd-cm
namespace: argocd
path: argocd-cm.patch.yaml

View File

@ -0,0 +1,32 @@
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: postgres-backup
spec:
# Backup the database every day at 2AM
schedule: "0 2 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: postgres-backup
image: postgres:12
command: ["/bin/sh"]
args: ["-c", 'echo "$PGPASS" > /root/.pgpass && chmod 600 /root/.pgpass && pg_dump -U postgres_admin -h postgres test_database > /var/backups/backup-$(date +"%m-%d-%Y-%H-%M").sql']
env:
- name: PGPASS
valueFrom:
secretKeyRef:
name: pgpass
key: pgpass
volumeMounts:
- mountPath: /var/backups
name: postgres-storage
restartPolicy: Never
volumes:
- name: postgres-storage
hostPath:
# Ensure the file directory is created.
path: /var/volumes/postgres-backups
type: DirectoryOrCreate

View File

@ -0,0 +1,5 @@
### Argo-apps collection
The applications and configurations specified in this folder represent the argo-specific configuration needed to deploy apps. The actual configuration of each app is located in its own folder under `/apps/<app-name>`.
Since each `application` is a kubernetes CRD they can be bundled through a kustomize setup.

View File

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: homeassistant-application
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/moll-re/k3s-infra.git
targetRevision: HEAD
path: apps/homeassistant
destination:
server: https://kubernetes.default.svc
namespace: homeassistant
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- application.yaml

View File

@ -8,4 +8,5 @@ resources:
- argocd-imageupdate/
- whoami/
- journal/
- immich/
- immich/
- homeassistant/