kustomize + helm now managed by argocd
This commit is contained in:
parent
d217b162ff
commit
73630c45da
@ -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:
|
||||
|
17
apps/homeassistant/kustomization.yaml
Normal file
17
apps/homeassistant/kustomization.yaml
Normal 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/
|
||||
|
@ -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
|
||||
|
3
infrastructure/argocd/argocd-cm.patch.yaml
Normal file
3
infrastructure/argocd/argocd-cm.patch.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- op: add
|
||||
path: /data/kustomize.buildOptions
|
||||
value: --enable-helm
|
@ -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
|
||||
|
32
infrastructure/backup/base/db-backup.cronjob.yaml
Normal file
32
infrastructure/backup/base/db-backup.cronjob.yaml
Normal 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
|
5
kluster-deployments/README.md
Normal file
5
kluster-deployments/README.md
Normal 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.
|
18
kluster-deployments/homeassistant/application.yaml
Normal file
18
kluster-deployments/homeassistant/application.yaml
Normal 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
|
4
kluster-deployments/homeassistant/kustomization.yaml
Normal file
4
kluster-deployments/homeassistant/kustomization.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- application.yaml
|
@ -9,3 +9,4 @@ resources:
|
||||
- whoami/
|
||||
- journal/
|
||||
- immich/
|
||||
- homeassistant/
|
Loading…
x
Reference in New Issue
Block a user