Clean
This commit is contained in:
parent
7114bc6db9
commit
c01735be71
13 changed files with 0 additions and 856 deletions
|
@ -1,44 +0,0 @@
|
|||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
name: home-server-databases
|
||||
namespace: argocd
|
||||
spec:
|
||||
generators:
|
||||
- list:
|
||||
elements:
|
||||
- name: mariadb-operators
|
||||
path: applications/20-databases/mariadb-operators
|
||||
wave: 1
|
||||
#- name: postgresql
|
||||
# path: applications/20-databases/postgresql
|
||||
# wave: 1
|
||||
#- name: influxdb
|
||||
# path: applications/20-databases/influxdb
|
||||
# wave: 1
|
||||
#- name: redis
|
||||
# path: applications/20-databases/redis
|
||||
# wave: 1
|
||||
- name: mariadb-database
|
||||
path: applications/20-databases/mariadb-database
|
||||
wave: 2
|
||||
template:
|
||||
metadata:
|
||||
name: '{{.name}}'
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: 'https://repobase.net/j/home-server.git'
|
||||
targetRevision: HEAD
|
||||
path: '{{.path}}'
|
||||
destination:
|
||||
server: 'https://kubernetes.default.svc'
|
||||
namespace: database
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
- SyncWave={{.wave}}
|
|
@ -1,77 +0,0 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: influxdb-pvc
|
||||
namespace: database
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: influxdb-pv
|
||||
namespace: database
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: local-storage
|
||||
hostPath:
|
||||
path: /dpool/services/influxdb/data
|
||||
type: DirectoryOrCreate
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- dck.hxme.net
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: influxdb
|
||||
namespace: database
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: influxdb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: influxdb
|
||||
spec:
|
||||
containers:
|
||||
- name: influxdb
|
||||
image: influxdb:2.7.12
|
||||
ports:
|
||||
- containerPort: 8086
|
||||
volumeMounts:
|
||||
- name: influxdb-storage
|
||||
mountPath: /var/lib/influxdb2
|
||||
env:
|
||||
- name: DOCKER_INFLUXDB_INIT_MODE
|
||||
value: "setup"
|
||||
- name: DOCKER_INFLUXDB_INIT_USERNAME
|
||||
value: "admin"
|
||||
- name: DOCKER_INFLUXDB_INIT_PASSWORD
|
||||
value: "adminpassword"
|
||||
- name: DOCKER_INFLUXDB_INIT_ORG
|
||||
value: "myorg"
|
||||
- name: DOCKER_INFLUXDB_INIT_BUCKET
|
||||
value: "mybucket"
|
||||
volumes:
|
||||
- name: influxdb-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: influxdb-pvc
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
apiVersion: k8s.mariadb.com/v1alpha1
|
||||
kind: MariaDB
|
||||
metadata:
|
||||
name: mariadb
|
||||
namespace: database
|
||||
spec:
|
||||
rootPasswordSecretKeyRef:
|
||||
name: db-secrets
|
||||
key: db-root-password
|
||||
|
||||
storage:
|
||||
size: 5Gi
|
|
@ -1,53 +0,0 @@
|
|||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: mariadb-operator-crds
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: "https://charts.mariadb.com/mariadb-operator"
|
||||
chart: "mariadb-operator-crds"
|
||||
targetRevision: "0.38.1"
|
||||
helm:
|
||||
releaseName: "mariadb-operator-crds"
|
||||
destination:
|
||||
server: "https://kubernetes.default.svc"
|
||||
namespace: database
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
- ApplyOutOfSyncOnly=true
|
||||
- SkipHooks=false
|
||||
- SyncWave=0 # ensure this is applied first
|
||||
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: mariadb-operator
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: "https://charts.mariadb.com/mariadb-operator"
|
||||
chart: "mariadb-operator"
|
||||
targetRevision: "0.38.1"
|
||||
helm:
|
||||
releaseName: "mariadb-operator"
|
||||
destination:
|
||||
server: "https://kubernetes.default.svc"
|
||||
namespace: database
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
- ApplyOutOfSyncOnly=true
|
||||
- SkipHooks=false
|
||||
- SyncWave=1 # ensure this waits for mariadb-operator-crds
|
|
@ -1,145 +0,0 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: postgres-pv
|
||||
namespace: database
|
||||
spec:
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: local-path
|
||||
hostPath:
|
||||
path: /dpool/services/postgres/data
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres-pvc
|
||||
namespace: database
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
volumeName: postgres-pv
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: postgres
|
||||
namespace: database
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
nodeSelector:
|
||||
role: dck
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:15
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: postgres-secret
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
volumes:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres-pvc
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres
|
||||
namespace: database
|
||||
spec:
|
||||
selector:
|
||||
app: postgres
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: postgres-backup-pv
|
||||
spec:
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: local-path
|
||||
hostPath:
|
||||
path: /dpool/services/postgres/backup
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres-backup-pvc
|
||||
namespace: database
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
|
||||
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: postgres-backup
|
||||
namespace: database
|
||||
spec:
|
||||
schedule: "0 2 * * *" # Every day at 2 AM
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
nodeSelector:
|
||||
role: dck
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: pg-backup
|
||||
image: postgres:15
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: postgres-secret
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
mkdir -p /backup
|
||||
PGPASSWORD=$POSTGRES_PASSWORD pg_dump -U $POSTGRES_USER -h localhost $POSTGRES_DB > /backup/backup-$(date +'%Y-%m-%d').sql
|
||||
volumeMounts:
|
||||
- name: backup-volume
|
||||
mountPath: /backup
|
||||
volumes:
|
||||
- name: backup-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres-backup-pvc
|
||||
|
||||
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: database
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
nodeSelector:
|
||||
role: dck
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: redis-data
|
||||
hostPath:
|
||||
path: /dpool/services/redis/data
|
||||
type: DirectoryOrCreate
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: database
|
||||
spec:
|
||||
selector:
|
||||
app: redis
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue