mirror of
https://github.com/auricom/home-cluster.git
synced 2025-10-02 00:34:25 +02:00
🍱 kube templates
This commit is contained in:
20
kubernetes/templates/gatus/external/configmap.yaml
vendored
Normal file
20
kubernetes/templates/gatus/external/configmap.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "${APP}-gatus-ep"
|
||||
labels:
|
||||
gatus.io/enabled: "true"
|
||||
data:
|
||||
config.yaml: |
|
||||
endpoints:
|
||||
- name: "${APP}"
|
||||
group: external
|
||||
url: "https://${GATUS_SUBDOMAIN:-${APP}}.${SECRET_CLUSTER_DOMAIN}${GATUS_PATH:-/}"
|
||||
interval: 1m
|
||||
client:
|
||||
dns-resolver: tcp://1.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == ${GATUS_STATUS:-200}"
|
||||
alerts:
|
||||
- type: pushover
|
6
kubernetes/templates/gatus/external/kustomization.yaml
vendored
Normal file
6
kubernetes/templates/gatus/external/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ./configmap.yaml
|
21
kubernetes/templates/gatus/guarded/configmap.yaml
Normal file
21
kubernetes/templates/gatus/guarded/configmap.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "${APP}-gatus-ep"
|
||||
labels:
|
||||
gatus.io/enabled: "true"
|
||||
data:
|
||||
config.yaml: |
|
||||
endpoints:
|
||||
- name: "${APP}"
|
||||
group: guarded
|
||||
url: "https://${GATUS_SUBDOMAIN:-${APP}}.${SECRET_CLUSTER_DOMAIN}${GATUS_PATH:-/}"
|
||||
interval: 1m
|
||||
ui:
|
||||
hide-hostname: true
|
||||
hide-url: true
|
||||
conditions:
|
||||
- "[STATUS] == ${GATUS_STATUS:-200}"
|
||||
alerts:
|
||||
- type: pushover
|
6
kubernetes/templates/gatus/guarded/kustomization.yaml
Normal file
6
kubernetes/templates/gatus/guarded/kustomization.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ./configmap.yaml
|
38
kubernetes/templates/volsync/README.md
Normal file
38
kubernetes/templates/volsync/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# VolSync Template
|
||||
|
||||
## Flux Kustomization
|
||||
|
||||
This requires `postBuild` configured on the Flux Kustomization
|
||||
|
||||
```yaml
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: &app plex
|
||||
namespace: flux-system
|
||||
spec:
|
||||
# ...
|
||||
postBuild:
|
||||
substitute:
|
||||
APP: *app
|
||||
VOLSYNC_CAPACITY: 5Gi
|
||||
```
|
||||
|
||||
and then call the template in your applications `kustomization.yaml`
|
||||
|
||||
```yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
# ...
|
||||
- ../../../../templates/volsync
|
||||
```
|
||||
|
||||
## Required `postBuild` vars:
|
||||
|
||||
- `APP`: The application name
|
||||
- `VOLSYNC_CAPACITY`: The PVC size
|
||||
|
||||
## Optional `postBuild` vars:
|
||||
|
||||
- TBD
|
15
kubernetes/templates/volsync/claim.yaml
Normal file
15
kubernetes/templates/volsync/claim.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: "${APP}"
|
||||
spec:
|
||||
accessModes: ["${VOLSYNC_ACCESSMODES:-ReadWriteOnce}"]
|
||||
dataSourceRef:
|
||||
kind: ReplicationDestination
|
||||
apiGroup: volsync.backube
|
||||
name: "${APP}-dst"
|
||||
resources:
|
||||
requests:
|
||||
storage: "${VOLSYNC_CAPACITY}"
|
||||
storageClassName: "${VOLSYNC_STORAGECLASS:-rook-ceph-block}"
|
7
kubernetes/templates/volsync/kustomization.yaml
Normal file
7
kubernetes/templates/volsync/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ./claim.yaml
|
||||
- ./minio.yaml
|
73
kubernetes/templates/volsync/minio.yaml
Normal file
73
kubernetes/templates/volsync/minio.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
|
||||
apiVersion: external-secrets.io/v1beta1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: "${APP}-volsync"
|
||||
spec:
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: onepassword-connect
|
||||
target:
|
||||
name: "${APP}-volsync-secret"
|
||||
template:
|
||||
engineVersion: v2
|
||||
data:
|
||||
RESTIC_REPOSITORY: "{{ .REPOSITORY_TEMPLATE }}/${APP}"
|
||||
RESTIC_PASSWORD: "{{ .RESTIC_PASSWORD }}"
|
||||
AWS_ACCESS_KEY_ID: "{{ .AWS_ACCESS_KEY_ID }}"
|
||||
AWS_SECRET_ACCESS_KEY: "{{ .AWS_SECRET_ACCESS_KEY }}"
|
||||
dataFrom:
|
||||
- extract:
|
||||
key: volsync-restic-template
|
||||
---
|
||||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/volsync.backube/replicationsource_v1alpha1.json
|
||||
apiVersion: volsync.backube/v1alpha1
|
||||
kind: ReplicationSource
|
||||
metadata:
|
||||
name: "${APP}"
|
||||
spec:
|
||||
sourcePVC: "${APP}"
|
||||
trigger:
|
||||
schedule: "0 7 * * *"
|
||||
restic:
|
||||
copyMethod: "${VOLSYNC_COPYMETHOD:-Snapshot}"
|
||||
pruneIntervalDays: 7
|
||||
repository: "${APP}-volsync-secret"
|
||||
volumeSnapshotClassName: "${VOLSYNC_SNAPSHOTCLASS:-csi-ceph-blockpool}"
|
||||
cacheCapacity: "${VOLSYNC_CACHE_CAPACITY:-8Gi}"
|
||||
cacheStorageClassName: "${VOLSYNC_CACHE_SNAPSHOTCLASS:-rook-ceph-block}"
|
||||
cacheAccessModes: ["${VOLSYNC_CACHE_ACCESSMODES:-ReadWriteOnce}"]
|
||||
storageClassName: "${VOLSYNC_STORAGECLASS:-rook-ceph-block}"
|
||||
accessModes: ["${VOLSYNC_ACCESSMODES:-ReadWriteOnce}"]
|
||||
moverSecurityContext:
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
fsGroup: 568
|
||||
retain:
|
||||
hourly: 24
|
||||
daily: 7
|
||||
weekly: 5
|
||||
---
|
||||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/volsync.backube/replicationdestination_v1alpha1.json
|
||||
apiVersion: volsync.backube/v1alpha1
|
||||
kind: ReplicationDestination
|
||||
metadata:
|
||||
name: "${APP}-dst"
|
||||
spec:
|
||||
trigger:
|
||||
manual: restore-once
|
||||
restic:
|
||||
repository: "${APP}-volsync-secret"
|
||||
copyMethod: Snapshot # must be Snapshot
|
||||
volumeSnapshotClassName: "${VOLSYNC_SNAPSHOTCLASS:-csi-ceph-blockpool}"
|
||||
cacheStorageClassName: "${VOLSYNC_CACHE_SNAPSHOTCLASS:-rook-ceph-block}"
|
||||
cacheAccessModes: ["${VOLSYNC_CACHE_ACCESSMODES:-ReadWriteOnce}"]
|
||||
cacheCapacity: "${VOLSYNC_CACHE_CAPACITY:-8Gi}"
|
||||
storageClassName: "${VOLSYNC_STORAGECLASS:-rook-ceph-block}"
|
||||
accessModes: ["${VOLSYNC_ACCESSMODES:-ReadWriteOnce}"]
|
||||
capacity: "${VOLSYNC_CAPACITY}"
|
||||
moverSecurityContext:
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
fsGroup: 568
|
Reference in New Issue
Block a user