mirror of
https://github.com/auricom/home-cluster.git
synced 2025-09-17 18:24:14 +02:00
feat: overhaul
This commit is contained in:
19
.archive/kubernetes/babybuddy/app/externalsecret.yaml
Normal file
19
.archive/kubernetes/babybuddy/app/externalsecret.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
|
||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: babybuddy
|
||||||
|
spec:
|
||||||
|
secretStoreRef:
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
name: onepassword-connect
|
||||||
|
target:
|
||||||
|
name: babybuddy-secret
|
||||||
|
template:
|
||||||
|
engineVersion: v2
|
||||||
|
data:
|
||||||
|
SECRET_KEY: "{{ .BABYBUDDY_SECRET_KEY }}"
|
||||||
|
dataFrom:
|
||||||
|
- extract:
|
||||||
|
key: babybuddy
|
@@ -4,7 +4,6 @@ apiVersion: helm.toolkit.fluxcd.io/v2
|
|||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
metadata:
|
metadata:
|
||||||
name: &app babybuddy
|
name: &app babybuddy
|
||||||
namespace: default
|
|
||||||
spec:
|
spec:
|
||||||
interval: 30m
|
interval: 30m
|
||||||
chart:
|
chart:
|
||||||
@@ -32,43 +31,17 @@ spec:
|
|||||||
babybuddy:
|
babybuddy:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
initContainers:
|
|
||||||
init-db:
|
|
||||||
image:
|
|
||||||
repository: ghcr.io/onedr0p/postgres-init
|
|
||||||
tag: 16
|
|
||||||
envFrom: &envFrom
|
|
||||||
- secretRef:
|
|
||||||
name: babybuddy-secret
|
|
||||||
migrations:
|
|
||||||
image:
|
|
||||||
repository: ghcr.io/auricom/babybuddy
|
|
||||||
tag: 2.7.0@sha256:39bc60fb6825d5bca296c078f599e00c6b9249d55992ddfe4200e6aa0841f86a
|
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
envFrom: *envFrom
|
|
||||||
command:
|
|
||||||
- /bin/bash
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
|
|
||||||
cd www/public
|
|
||||||
python3 ./manage.py migrate --noinput
|
|
||||||
python3 ./manage.py createcachetable
|
|
||||||
containers:
|
containers:
|
||||||
app:
|
app:
|
||||||
image:
|
image:
|
||||||
repository: ghcr.io/auricom/babybuddy
|
repository: lscr.io/linuxserver/babybuddy
|
||||||
tag: 2.7.0@sha256:e112563cbd34c4283e8cf5ee756dbed695799dcefe4f035f9495beacb6415d12
|
tag: 2.7.0@sha256:579e8f62bed981ed94c021de60a302ba01c22c971ba2bacfcf821650fbc89e9d
|
||||||
env:
|
env:
|
||||||
TZ: ${TIMEZONE}
|
TZ: ${TIMEZONE}
|
||||||
EMAIL_HOST: smtp-relay.default.svc.cluster.local.
|
CSRF_TRUSTED_ORIGINS: https://{{ .Release.Name }}.${SECRET_EXTERNAL_DOMAIN}
|
||||||
EMAIL_PORT: "2525"
|
envFrom:
|
||||||
EMAIL_USE_TLS: "false"
|
- secretRef:
|
||||||
envFrom: *envFrom
|
name: babybuddy-secret
|
||||||
probes:
|
probes:
|
||||||
liveness: &probes
|
liveness: &probes
|
||||||
enabled: true
|
enabled: true
|
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
@@ -16,6 +16,7 @@ spec:
|
|||||||
kind: GitRepository
|
kind: GitRepository
|
||||||
name: home-ops-kubernetes
|
name: home-ops-kubernetes
|
||||||
dependsOn:
|
dependsOn:
|
||||||
|
- name: crunchy-postgres-operator-cluster
|
||||||
- name: external-secrets-stores
|
- name: external-secrets-stores
|
||||||
- name: volsync
|
- name: volsync
|
||||||
wait: false
|
wait: false
|
@@ -4,8 +4,8 @@ kind: Cluster
|
|||||||
metadata:
|
metadata:
|
||||||
name: postgres16
|
name: postgres16
|
||||||
spec:
|
spec:
|
||||||
instances: 4 # set to the number of nodes in the cluster
|
instances: 1
|
||||||
imageName: ghcr.io/cloudnative-pg/postgresql:16.2-10@sha256:82827bc9bc5ca7df1d7f7d4813444e0e7a8e32633ad72c5c66ad2be72c3b2095
|
imageName: ghcr.io/cloudnative-pg/postgresql:16.2
|
||||||
primaryUpdateStrategy: unsupervised
|
primaryUpdateStrategy: unsupervised
|
||||||
storage:
|
storage:
|
||||||
size: 50Gi
|
size: 50Gi
|
||||||
@@ -37,34 +37,28 @@ spec:
|
|||||||
wal:
|
wal:
|
||||||
compression: bzip2
|
compression: bzip2
|
||||||
maxParallel: 8
|
maxParallel: 8
|
||||||
destinationPath: s3://postgresql/
|
destinationPath: &dest s3://postgresql/
|
||||||
endpointURL: https://s3.${SECRET_INTERNAL_DOMAIN}
|
endpointURL: &url https://s3.${SECRET_INTERNAL_DOMAIN}
|
||||||
# Note: serverName version needs to be inclemented
|
# Note: serverName version needs to be inclemented
|
||||||
# when recovering from an existing cnpg cluster
|
# when recovering from an existing cnpg cluster
|
||||||
serverName: postgres16-v4
|
serverName: postgres16-v5
|
||||||
s3Credentials:
|
s3Credentials: &credentials
|
||||||
accessKeyId:
|
accessKeyId:
|
||||||
name: cloudnative-pg-secret
|
name: cloudnative-pg-secret
|
||||||
key: aws-access-key-id
|
key: aws-access-key-id
|
||||||
secretAccessKey:
|
secretAccessKey:
|
||||||
name: cloudnative-pg-secret
|
name: cloudnative-pg-secret
|
||||||
key: aws-secret-access-key
|
key: aws-secret-access-key
|
||||||
# # Note: previousCluster needs to be set to the name of the previous
|
# Note: previousCluster needs to be set to the name of the previous
|
||||||
# # cluster when recovering from an existing cnpg cluster
|
# cluster when recovering from an existing cnpg cluster
|
||||||
# bootstrap:
|
bootstrap:
|
||||||
# recovery:
|
recovery:
|
||||||
# source: postgres16-v3
|
source: &backup postgres16-v4
|
||||||
# externalClusters:
|
externalClusters:
|
||||||
# - name: postgres16-v3
|
- name: *backup
|
||||||
# barmanObjectStore:
|
barmanObjectStore:
|
||||||
# destinationPath: s3://postgresql/
|
destinationPath: *dest
|
||||||
# endpointURL: https://s3.${SECRET_INTERNAL_DOMAIN}
|
endpointURL: *url
|
||||||
# s3Credentials:
|
s3Credentials: *credentials
|
||||||
# accessKeyId:
|
wal:
|
||||||
# name: cloudnative-pg-secret
|
maxParallel: 8
|
||||||
# key: aws-access-key-id
|
|
||||||
# secretAccessKey:
|
|
||||||
# name: cloudnative-pg-secret
|
|
||||||
# key: aws-secret-access-key
|
|
||||||
# wal:
|
|
||||||
# maxParallel: 8
|
|
@@ -3,19 +3,19 @@
|
|||||||
apiVersion: external-secrets.io/v1beta1
|
apiVersion: external-secrets.io/v1beta1
|
||||||
kind: ExternalSecret
|
kind: ExternalSecret
|
||||||
metadata:
|
metadata:
|
||||||
name: cloudnative-pg-postgres16-pgdump
|
name: cloudnative-pg-postgres17-pgdump
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
secretStoreRef:
|
secretStoreRef:
|
||||||
kind: ClusterSecretStore
|
kind: ClusterSecretStore
|
||||||
name: onepassword-connect
|
name: onepassword-connect
|
||||||
target:
|
target:
|
||||||
name: cloudnative-pg-postgres16-pgdump-secret
|
name: cloudnative-pg-postgres17-pgdump-secret
|
||||||
template:
|
template:
|
||||||
engineVersion: v2
|
engineVersion: v2
|
||||||
data:
|
data:
|
||||||
# App
|
# App
|
||||||
POSTGRES_HOST: postgres16-rw.database.svc.cluster.local
|
POSTGRES_HOST: postgres17-rw.database.svc.cluster.local
|
||||||
POSTGRES_USER: "{{ .POSTGRES_SUPER_USER }}"
|
POSTGRES_USER: "{{ .POSTGRES_SUPER_USER }}"
|
||||||
POSTGRES_PASSWORD: "{{ .POSTGRES_SUPER_PASS }}"
|
POSTGRES_PASSWORD: "{{ .POSTGRES_SUPER_PASS }}"
|
||||||
POSTGRES_PORT: "5432"
|
POSTGRES_PORT: "5432"
|
@@ -3,7 +3,7 @@
|
|||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
metadata:
|
metadata:
|
||||||
name: &app cloudnative-pg-postgres16-pgdump
|
name: &app cloudnative-pg-postgres17-pgdump
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
interval: 30m
|
interval: 30m
|
||||||
@@ -29,7 +29,7 @@ spec:
|
|||||||
keepHistory: false
|
keepHistory: false
|
||||||
values:
|
values:
|
||||||
controllers:
|
controllers:
|
||||||
cloudnative-pg-postgres16-pgdump:
|
cloudnative-pg-postgres17-pgdump:
|
||||||
type: cronjob
|
type: cronjob
|
||||||
cronjob:
|
cronjob:
|
||||||
concurrencyPolicy: Forbid
|
concurrencyPolicy: Forbid
|
||||||
@@ -38,18 +38,18 @@ spec:
|
|||||||
init-db:
|
init-db:
|
||||||
image:
|
image:
|
||||||
repository: ghcr.io/onedr0p/postgres-init
|
repository: ghcr.io/onedr0p/postgres-init
|
||||||
tag: 16
|
tag: 17
|
||||||
env:
|
env:
|
||||||
EXCLUDE_DBS: app home_assistant lidarr_log radarr_log sonarr_log prowlarr_log postgres template0 template1
|
EXCLUDE_DBS: app home_assistant lidarr_log radarr_log sonarr_log prowlarr_log postgres template0 template1
|
||||||
envFrom: &envFrom
|
envFrom: &envFrom
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: cloudnative-pg-postgres16-pgdump-secret
|
name: cloudnative-pg-postgres17-pgdump-secret
|
||||||
command: /scripts/list_dbs.sh
|
command: /scripts/list_dbs.sh
|
||||||
containers:
|
containers:
|
||||||
app:
|
app:
|
||||||
image:
|
image:
|
||||||
repository: prodrigestivill/postgres-backup-local
|
repository: prodrigestivill/postgres-backup-local
|
||||||
tag: 16-alpine@sha256:d41309ea4abc06b1d369927cafa7abb8b9cccab21921dcb5d765379fcd9d60cb
|
tag: 17-alpine@sha256:d41309ea4abc06b1d369927cafa7abb8b9cccab21921dcb5d765379fcd9d60cb
|
||||||
command: [/backup.sh]
|
command: [/backup.sh]
|
||||||
env:
|
env:
|
||||||
POSTGRES_DB_FILE: /config/db_list
|
POSTGRES_DB_FILE: /config/db_list
|
||||||
@@ -79,7 +79,7 @@ spec:
|
|||||||
scripts:
|
scripts:
|
||||||
enabled: true
|
enabled: true
|
||||||
type: configMap
|
type: configMap
|
||||||
name: cloudnative-pg-postgres16-pgdump-scripts # overriden by kustomizeconfig
|
name: cloudnative-pg-postgres17-pgdump-scripts # overriden by kustomizeconfig
|
||||||
defaultMode: 0775
|
defaultMode: 0775
|
||||||
globalMounts:
|
globalMounts:
|
||||||
- path: /scripts
|
- path: /scripts
|
@@ -16,7 +16,7 @@ spec:
|
|||||||
data:
|
data:
|
||||||
# App
|
# App
|
||||||
INVIDIOUS_CONFIG: |
|
INVIDIOUS_CONFIG: |
|
||||||
database_url: postgres://{{ .POSTGRES_USER }}:{{ .POSTGRES_PASS }}@postgres16-rw.database.svc.cluster.local.:5432/invidious
|
database_url: postgres://{{ .POSTGRES_USER }}:{{ .POSTGRES_PASS }}@postgres17-rw.database.svc.cluster.local.:5432/invidious
|
||||||
check_tables: true
|
check_tables: true
|
||||||
port: 3000
|
port: 3000
|
||||||
domain: invidious.${SECRET_EXTERNAL_DOMAIN}
|
domain: invidious.${SECRET_EXTERNAL_DOMAIN}
|
||||||
@@ -24,7 +24,7 @@ spec:
|
|||||||
hmac_key: {{ .HMAC_KEY }}
|
hmac_key: {{ .HMAC_KEY }}
|
||||||
# Postgres Init
|
# Postgres Init
|
||||||
INIT_POSTGRES_DBNAME: invidious
|
INIT_POSTGRES_DBNAME: invidious
|
||||||
INIT_POSTGRES_HOST: postgres16-rw.database.svc.cluster.local
|
INIT_POSTGRES_HOST: postgres17-rw.database.svc.cluster.local
|
||||||
INIT_POSTGRES_USER: "{{ .POSTGRES_USER }}"
|
INIT_POSTGRES_USER: "{{ .POSTGRES_USER }}"
|
||||||
INIT_POSTGRES_PASS: "{{ .POSTGRES_PASS }}"
|
INIT_POSTGRES_PASS: "{{ .POSTGRES_PASS }}"
|
||||||
INIT_POSTGRES_SUPER_PASS: "{{ .POSTGRES_SUPER_PASS }}"
|
INIT_POSTGRES_SUPER_PASS: "{{ .POSTGRES_SUPER_PASS }}"
|
@@ -15,7 +15,7 @@ spec:
|
|||||||
engineVersion: v2
|
engineVersion: v2
|
||||||
data:
|
data:
|
||||||
# App
|
# App
|
||||||
KRESUS_DB_HOST: &dbHost postgres16-rw.database.svc.cluster.local
|
KRESUS_DB_HOST: &dbHost postgres17-rw.database.svc.cluster.local
|
||||||
KRESUS_DB_USERNAME: &dbUser "{{ .POSTGRES_USERNAME }}"
|
KRESUS_DB_USERNAME: &dbUser "{{ .POSTGRES_USERNAME }}"
|
||||||
KRESUS_DB_PASSWORD: &dbPass "{{ .POSTGRES_PASSWORD }}"
|
KRESUS_DB_PASSWORD: &dbPass "{{ .POSTGRES_PASSWORD }}"
|
||||||
KRESUS_DB_NAME: &dbName kresus
|
KRESUS_DB_NAME: &dbName kresus
|
@@ -58,7 +58,7 @@ spec:
|
|||||||
LANG: C.UTF-8
|
LANG: C.UTF-8
|
||||||
KRESUS_DB_TYPE: postgres
|
KRESUS_DB_TYPE: postgres
|
||||||
KRESUS_DIR: /config
|
KRESUS_DIR: /config
|
||||||
KRESUS_EMAIL_HOST: mailrise.monitoring.svc.cluster.local
|
KRESUS_EMAIL_HOST: mailrise.observability.svc.cluster.local
|
||||||
KRESUS_EMAIL_PORT: 8025
|
KRESUS_EMAIL_PORT: 8025
|
||||||
KRESUS_EMAIL_TRANSPORT: smtp
|
KRESUS_EMAIL_TRANSPORT: smtp
|
||||||
KRESUS_EMAIL_FROM: kresus@mailrise.home.arpa
|
KRESUS_EMAIL_FROM: kresus@mailrise.home.arpa
|
@@ -16,7 +16,7 @@ spec:
|
|||||||
data:
|
data:
|
||||||
# App
|
# App
|
||||||
SECRET_KEY_BASE: "{{ .MAYBE__SECRET_KEY_BASE }}"
|
SECRET_KEY_BASE: "{{ .MAYBE__SECRET_KEY_BASE }}"
|
||||||
DB_HOST: &dbHost postgres16-rw.database.svc.cluster.local
|
DB_HOST: &dbHost postgres17-rw.database.svc.cluster.local
|
||||||
POSTGRES_DB: &dbName maybe
|
POSTGRES_DB: &dbName maybe
|
||||||
POSTGRES_USER: &dbUser "{{ .MAYBE__POSTGRES_USER }}"
|
POSTGRES_USER: &dbUser "{{ .MAYBE__POSTGRES_USER }}"
|
||||||
POSTGRES_PASSWORD: &dbPass "{{ .MAYBE__POSTGRES_PASS }}"
|
POSTGRES_PASSWORD: &dbPass "{{ .MAYBE__POSTGRES_PASS }}"
|
@@ -2,7 +2,6 @@
|
|||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namespace: default
|
|
||||||
resources:
|
resources:
|
||||||
- ./externalsecret.yaml
|
- ./externalsecret.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
@@ -20,7 +20,7 @@ spec:
|
|||||||
MYSQL_ROOT_PASSWORD: &dbPass "{{ .PLANTIT__MARIADB_ROOT_PASS }}"
|
MYSQL_ROOT_PASSWORD: &dbPass "{{ .PLANTIT__MARIADB_ROOT_PASS }}"
|
||||||
MYSQL_USERNAME: "{{ .PLANTIT__MARIADB_USER }}"
|
MYSQL_USERNAME: "{{ .PLANTIT__MARIADB_USER }}"
|
||||||
MYSQL_PSW: *dbPass
|
MYSQL_PSW: *dbPass
|
||||||
FLORACODEX_KEY: "{{ .PLANTIT__FLORACODEX_KEY }}"
|
FLORACODEX_KEY: "{{ .PLANTIT__TREFLE_KEY }}"
|
||||||
JWT_SECRET: "{{ .PLANTIT__JWT_SECRET }}"
|
JWT_SECRET: "{{ .PLANTIT__JWT_SECRET }}"
|
||||||
|
|
||||||
dataFrom:
|
dataFrom:
|
@@ -4,7 +4,6 @@ apiVersion: helm.toolkit.fluxcd.io/v2
|
|||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
metadata:
|
metadata:
|
||||||
name: thanos
|
name: thanos
|
||||||
namespace: monitoring
|
|
||||||
spec:
|
spec:
|
||||||
interval: 30m
|
interval: 30m
|
||||||
timeout: 15m
|
timeout: 15m
|
||||||
@@ -57,8 +56,8 @@ spec:
|
|||||||
config:
|
config:
|
||||||
insecure: true
|
insecure: true
|
||||||
additionalEndpoints:
|
additionalEndpoints:
|
||||||
- dnssrv+_grpc._tcp.kube-prometheus-stack-thanos-discovery.monitoring.svc.cluster.local
|
- dnssrv+_grpc._tcp.kube-prometheus-stack-thanos-discovery.observability.svc.cluster.local
|
||||||
additionalReplicaLabels: ["__replica__"]
|
additionalReplicaLabels: [__replica__]
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
enabled: true
|
enabled: true
|
||||||
compact:
|
compact:
|
||||||
@@ -86,10 +85,10 @@ spec:
|
|||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: &configMap thanos-cache-configmap
|
name: &configMap thanos-cache-configmap
|
||||||
key: cache.yaml
|
key: cache.yaml
|
||||||
extraArgs: ["--query-range.response-cache-config=$(THANOS_CACHE_CONFIG)"]
|
extraArgs: [--query-range.response-cache-config=$(THANOS_CACHE_CONFIG)]
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
ingressClassName: nginx
|
ingressClassName: internal
|
||||||
annotations:
|
annotations:
|
||||||
gethomepage.dev/enabled: "true"
|
gethomepage.dev/enabled: "true"
|
||||||
gethomepage.dev/name: Thanos
|
gethomepage.dev/name: Thanos
|
||||||
@@ -107,13 +106,13 @@ spec:
|
|||||||
rule:
|
rule:
|
||||||
enabled: true
|
enabled: true
|
||||||
replicas: 3
|
replicas: 3
|
||||||
extraArgs: ["--web.prefix-header=X-Forwarded-Prefix"]
|
extraArgs: [--web.prefix-header=X-Forwarded-Prefix]
|
||||||
alertmanagersConfig:
|
alertmanagersConfig:
|
||||||
value: |-
|
value: |-
|
||||||
alertmanagers:
|
alertmanagers:
|
||||||
- api_version: v2
|
- api_version: v2
|
||||||
static_configs:
|
static_configs:
|
||||||
- dnssrv+_http-web._tcp.alertmanager-operated.monitoring.svc.cluster.local
|
- dnssrv+_http-web._tcp.alertmanager-operated.observability.svc.cluster.local
|
||||||
rules:
|
rules:
|
||||||
value: |-
|
value: |-
|
||||||
groups:
|
groups:
|
@@ -2,7 +2,6 @@
|
|||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namespace: monitoring
|
|
||||||
resources:
|
resources:
|
||||||
- ./objectbucketclaim.yaml
|
- ./objectbucketclaim.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
@@ -6,14 +6,15 @@ metadata:
|
|||||||
name: &app thanos
|
name: &app thanos
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
spec:
|
spec:
|
||||||
targetNamespace: monitoring
|
targetNamespace: observability
|
||||||
commonMetadata:
|
commonMetadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: *app
|
app.kubernetes.io/name: *app
|
||||||
dependsOn:
|
dependsOn:
|
||||||
|
- name: dragonfly-cluster
|
||||||
- name: external-secrets-stores
|
- name: external-secrets-stores
|
||||||
- name: rook-ceph-cluster
|
- name: rook-ceph-cluster
|
||||||
path: ./kubernetes/apps/monitoring/thanos/app
|
path: ./kubernetes/apps/observability/thanos/app
|
||||||
prune: true
|
prune: true
|
||||||
sourceRef:
|
sourceRef:
|
||||||
kind: GitRepository
|
kind: GitRepository
|
19
.archive/kubernetes/windmill/app/externalsecret.yaml
Normal file
19
.archive/kubernetes/windmill/app/externalsecret.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
|
||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: windmill
|
||||||
|
spec:
|
||||||
|
secretStoreRef:
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
name: crunchy-pgo-secrets
|
||||||
|
target:
|
||||||
|
name: windmill-secret
|
||||||
|
template:
|
||||||
|
engineVersion: v2
|
||||||
|
data:
|
||||||
|
WINDMILL_POSTGRES_URL: 'postgres://{{ index . "user" }}:{{ index . "password" }}@{{ index . "host" }}/{{ index . "dbname" }}'
|
||||||
|
dataFrom:
|
||||||
|
- extract:
|
||||||
|
key: postgres-pguser-windmill
|
@@ -29,37 +29,6 @@ spec:
|
|||||||
app:
|
app:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
initContainers:
|
|
||||||
- name: init-db
|
|
||||||
image: ghcr.io/onedr0p/postgres-init:16
|
|
||||||
envFrom:
|
|
||||||
- secretRef:
|
|
||||||
name: &secret windmill-secret
|
|
||||||
- name: init-grants
|
|
||||||
image: ghcr.io/onedr0p/postgres-init:16
|
|
||||||
command:
|
|
||||||
- /bin/bash
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
|
|
||||||
/var/run/grants.sh
|
|
||||||
envFrom:
|
|
||||||
- secretRef:
|
|
||||||
name: *secret
|
|
||||||
volumeMounts:
|
|
||||||
- name: grants
|
|
||||||
readOnly: true
|
|
||||||
subPath: grants.sh
|
|
||||||
mountPath: /var/run/grants.sh
|
|
||||||
volumes:
|
|
||||||
- name: grants
|
|
||||||
configMap:
|
|
||||||
name: windmill-grants
|
|
||||||
defaultMode: 509
|
|
||||||
baseDomain: &host "windmill.${SECRET_EXTERNAL_DOMAIN}"
|
baseDomain: &host "windmill.${SECRET_EXTERNAL_DOMAIN}"
|
||||||
baseProtocol: https
|
baseProtocol: https
|
||||||
appReplicas: 1
|
appReplicas: 1
|
||||||
@@ -105,6 +74,6 @@ spec:
|
|||||||
enabled: false
|
enabled: false
|
||||||
valuesFrom:
|
valuesFrom:
|
||||||
- kind: Secret
|
- kind: Secret
|
||||||
name: *secret
|
name: windmill-secret
|
||||||
valuesKey: WINDMILL_POSTGRES_URL
|
valuesKey: WINDMILL_POSTGRES_URL
|
||||||
targetPath: windmill.databaseUrl
|
targetPath: windmill.databaseUrl
|
9
.archive/kubernetes/windmill/app/kustomization.yaml
Normal file
9
.archive/kubernetes/windmill/app/kustomization.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: default
|
||||||
|
resources:
|
||||||
|
- ./externalsecret.yaml
|
||||||
|
- ./helmrelease.yaml
|
||||||
|
- ../../../../templates/gatus/guarded
|
@@ -11,6 +11,7 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: *app
|
app.kubernetes.io/name: *app
|
||||||
dependsOn:
|
dependsOn:
|
||||||
|
- name: crunchy-postgres-operator-cluster
|
||||||
- name: external-secrets-stores
|
- name: external-secrets-stores
|
||||||
path: ./kubernetes/apps/default/windmill/app
|
path: ./kubernetes/apps/default/windmill/app
|
||||||
prune: true
|
prune: true
|
51
.taskfiles/bootstrap/Taskfile.yaml
Normal file
51
.taskfiles/bootstrap/Taskfile.yaml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
vars:
|
||||||
|
BOOTSTRAP_RESOURCES_DIR: '{{.ROOT_DIR}}/.taskfiles/bootstrap/resources'
|
||||||
|
CLUSTER_DIR: '{{.ROOT_DIR}}/kubernetes'
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
base:
|
||||||
|
desc: Bootstrap Base Apps
|
||||||
|
cmds:
|
||||||
|
- until kubectl wait nodes --for=condition=Ready=False --all --timeout=10m; do sleep 5; done
|
||||||
|
- helmfile --quiet --file {{.CLUSTER_DIR}}/bootstrap/apps/helmfile.yaml apply --skip-diff-on-install --suppress-diff
|
||||||
|
- until kubectl wait nodes --for=condition=Ready --all --timeout=10m; do sleep 5; done
|
||||||
|
preconditions:
|
||||||
|
- talosctl config info
|
||||||
|
# - test -f {{.CLUSTER_DIR}}/talos/cluster-0/talosconfig
|
||||||
|
- test -f {{.CLUSTER_DIR}}/bootstrap/apps/helmfile.yaml
|
||||||
|
- which helmfile kubectl
|
||||||
|
|
||||||
|
# NOTE: Nodes must all be part of the Ceph cluster and Ceph disks must share the same disk model
|
||||||
|
rook:
|
||||||
|
desc: Bootstrap Rook-Ceph
|
||||||
|
cmds:
|
||||||
|
- minijinja-cli {{.BOOTSTRAP_RESOURCES_DIR}}/wipe-rook.yaml.j2 | kubectl apply --server-side --filename -
|
||||||
|
- until kubectl --namespace default get job/wipe-rook &>/dev/null; do sleep 5; done
|
||||||
|
- kubectl --namespace default wait job/wipe-rook --for=condition=complete --timeout=5m
|
||||||
|
- stern --namespace default job/wipe-rook --no-follow
|
||||||
|
- kubectl --namespace default delete job wipe-rook
|
||||||
|
env:
|
||||||
|
NODE_COUNT:
|
||||||
|
sh: talosctl config info --output json | jq --raw-output '.nodes | length'
|
||||||
|
preconditions:
|
||||||
|
- test -f {{.BOOTSTRAP_RESOURCES_DIR}}/wipe-rook.yaml.j2
|
||||||
|
- which jq kubectl minijinja-cli stern talosctl
|
||||||
|
|
||||||
|
flux:
|
||||||
|
desc: Bootstrap Flux
|
||||||
|
cmds:
|
||||||
|
- kubectl create namespace flux-system --dry-run=client -o yaml | kubectl apply --filename -
|
||||||
|
- cat {{.SOPS_AGE_KEY}} | kubectl --namespace flux-system create secret generic sops-age --from-file=age.agekey=/dev/stdin
|
||||||
|
- kubectl apply --server-side --kustomize {{.CLUSTER_DIR}}/bootstrap/flux
|
||||||
|
- SOPS_AGE_KEY_FILE={{.SOPS_AGE_KEY}} sops exec-file {{.CLUSTER_DIR}}/bootstrap/flux/github-deploy-key.sops.yaml "kubectl apply --server-side --filename {}"
|
||||||
|
- SOPS_AGE_KEY_FILE={{.SOPS_AGE_KEY}} sops exec-file {{.CLUSTER_DIR}}/flux/vars/cluster-secrets.sops.yaml "kubectl apply --server-side --filename {}"
|
||||||
|
- kubectl apply --server-side --filename ./flux/vars/cluster-settings.yaml
|
||||||
|
|
||||||
|
apps:
|
||||||
|
desc: Bootstrap Flux
|
||||||
|
- kubectl apply --server-side --kustomize {{.CLUSTER_DIR}}/flux/config
|
49
.taskfiles/bootstrap/resources/wipe-rook.yaml.j2
Normal file
49
.taskfiles/bootstrap/resources/wipe-rook.yaml.j2
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: &app wipe-rook
|
||||||
|
namespace: default
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
spec:
|
||||||
|
parallelism: 4
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
spec:
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: disk-wipe
|
||||||
|
image: rook/ceph:master
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
command:
|
||||||
|
[
|
||||||
|
"/bin/sh",
|
||||||
|
"-c",
|
||||||
|
"echo 'Starting disk operations on /dev/sdb'; \
|
||||||
|
echo 'Running sgdisk --zap-all /dev/sdb'; time sgdisk --zap-all /dev/sdb; \
|
||||||
|
echo 'Running dd if=/dev/zero bs=1M count=10000 oflag=direct of=/dev/sdb'; time dd if=/dev/zero bs=1M count=10000 oflag=direct of=/dev/sdb; \
|
||||||
|
echo 'Running blkdiscard /dev/sdb'; time blkdiscard /dev/sdb; \
|
||||||
|
echo 'Running partprobe /dev/sdb'; time partprobe /dev/sdb; \
|
||||||
|
echo 'Disk operations completed on /dev/sdb'"
|
||||||
|
]
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /dev
|
||||||
|
name: dev
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
runAsGroup: 0
|
||||||
|
volumes:
|
||||||
|
- name: dev
|
||||||
|
hostPath:
|
||||||
|
path: /dev
|
||||||
|
topologySpreadConstraints:
|
||||||
|
- maxSkew: 1
|
||||||
|
labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
whenUnsatisfiable: DoNotSchedule
|
@@ -19,8 +19,8 @@ tasks:
|
|||||||
"containers": [
|
"containers": [
|
||||||
{
|
{
|
||||||
"name": "debug",
|
"name": "debug",
|
||||||
"image": "ghcr.io/onedr0p/alpine:rolling",
|
"image": "cgr.dev/chainguard/wolfi-base",
|
||||||
"command": ["/bin/bash"],
|
"command": ["sleep","9999999"],
|
||||||
"stdin": true,
|
"stdin": true,
|
||||||
"stdinOnce": true,
|
"stdinOnce": true,
|
||||||
"tty": true,
|
"tty": true,
|
||||||
@@ -44,8 +44,8 @@ tasks:
|
|||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
requires:
|
requires:
|
||||||
vars: ["claim"]
|
vars: [claim]
|
||||||
vars:
|
vars:
|
||||||
ns: '{{.ns | default "default"}}'
|
ns: '{{.ns | default "default"}}'
|
||||||
preconditions:
|
preconditions:
|
||||||
- { msg: "PVC not found", sh: "kubectl -n {{.ns}} get persistentvolumeclaim {{.claim}}" }
|
- { msg: PVC not found, sh: "kubectl -n {{.ns}} get persistentvolumeclaim {{.claim}}" }
|
@@ -19,8 +19,8 @@ x-env: &env
|
|||||||
ts: '{{.ts}}'
|
ts: '{{.ts}}'
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
scriptsDir: '{{.ROOT_DIR}}/.taskfiles/VolSync/scripts'
|
scriptsDir: '{{.ROOT_DIR}}/.taskfiles/volsync/scripts'
|
||||||
templatesDir: '{{.ROOT_DIR}}/.taskfiles/VolSync/templates'
|
templatesDir: '{{.ROOT_DIR}}/.taskfiles/volsync/templates'
|
||||||
ts: '{{now | date "150405"}}'
|
ts: '{{now | date "150405"}}'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
@@ -13,7 +13,7 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[](https://discord.gg/k8s-at-home)
|
[](https://discord.gg/k8s-at-home)
|
||||||
[](https://talos.dev/)
|
[](https://talos.dev/)
|
||||||
[](https://github.com/auricom/home-ops/actions/workflows/renovate.yaml)
|
[](https://github.com/auricom/home-ops/actions/workflows/renovate.yaml)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
13
Taskfile.yml
13
Taskfile.yml
@@ -14,12 +14,13 @@ env:
|
|||||||
SOPS_AGE_KEY_FILE: "~/.config/sops/age/keys.txt"
|
SOPS_AGE_KEY_FILE: "~/.config/sops/age/keys.txt"
|
||||||
|
|
||||||
includes:
|
includes:
|
||||||
ansible: .taskfiles/Ansible/Taskfile.yaml
|
ansible: .taskfiles/ansible/Taskfile.yaml
|
||||||
external-secrets: .taskfiles/ExternalSecrets/Taskfile.yaml
|
bootstrap: .taskfiles/bootstrap/Taskfile.yaml
|
||||||
flux: .taskfiles/Flux/Taskfile.yaml
|
external-secrets: .taskfiles/externalsecrets/Taskfile.yaml
|
||||||
kubernetes: .taskfiles/Kubernetes/Taskfile.yaml
|
flux: .taskfiles/flux/Taskfile.yaml
|
||||||
sops: .taskfiles/Sops/Taskfile.yaml
|
kubernetes: .taskfiles/kubernetes/Taskfile.yaml
|
||||||
volsync: .taskfiles/VolSync/Taskfile.yaml
|
sops: .taskfiles/sops/Taskfile.yaml
|
||||||
|
volsync: .taskfiles/volsync/Taskfile.yaml
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
@@ -25,7 +25,7 @@ spec:
|
|||||||
substitute:
|
substitute:
|
||||||
APP: *app
|
APP: *app
|
||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
|
@@ -15,7 +15,7 @@ metadata:
|
|||||||
namespace: actions-runner-system
|
namespace: actions-runner-system
|
||||||
spec:
|
spec:
|
||||||
type: alertmanager
|
type: alertmanager
|
||||||
address: http://kube-prometheus-stack-alertmanager.monitoring:9093/api/v2/alerts/
|
address: http://kube-prometheus-stack-alertmanager.observability:9093/api/v2/alerts/
|
||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/notification.toolkit.fluxcd.io/alert_v1beta3.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/notification.toolkit.fluxcd.io/alert_v1beta3.json
|
||||||
apiVersion: notification.toolkit.fluxcd.io/v1beta3
|
apiVersion: notification.toolkit.fluxcd.io/v1beta3
|
||||||
|
@@ -38,4 +38,4 @@ spec:
|
|||||||
enabled: true
|
enabled: true
|
||||||
servicemonitor:
|
servicemonitor:
|
||||||
enabled: true
|
enabled: true
|
||||||
prometheusInstance: monitoring
|
prometheusInstance: observability
|
||||||
|
@@ -3,15 +3,18 @@
|
|||||||
apiVersion: external-secrets.io/v1beta1
|
apiVersion: external-secrets.io/v1beta1
|
||||||
kind: ExternalSecret
|
kind: ExternalSecret
|
||||||
metadata:
|
metadata:
|
||||||
name: cert-manager-webhook-ovh
|
name: cloudflare
|
||||||
namespace: cert-manager
|
namespace: cert-manager
|
||||||
spec:
|
spec:
|
||||||
secretStoreRef:
|
secretStoreRef:
|
||||||
kind: ClusterSecretStore
|
kind: ClusterSecretStore
|
||||||
name: onepassword-connect
|
name: onepassword-connect
|
||||||
target:
|
target:
|
||||||
name: cert-manager-webhook-ovh-secret
|
name: cloudflare-secret
|
||||||
|
template:
|
||||||
|
engineVersion: v2
|
||||||
|
data:
|
||||||
|
CLOUDFLARE_TOKEN: "{{ .CLOUDFLARE_TOKEN }}"
|
||||||
dataFrom:
|
dataFrom:
|
||||||
- extract:
|
- extract:
|
||||||
# applicationKey, applicationSecret, consumerKey
|
key: cloudflare
|
||||||
key: cert-manager-webhook-ovh
|
|
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/cert-manager.io/clusterissuer_v1.json
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: ClusterIssuer
|
||||||
|
metadata:
|
||||||
|
name: letsencrypt-production
|
||||||
|
spec:
|
||||||
|
acme:
|
||||||
|
server: https://acme-v02.api.letsencrypt.org/directory
|
||||||
|
email: "${SECRET_CLUSTER_DOMAIN_EMAIL}"
|
||||||
|
privateKeySecretRef:
|
||||||
|
name: letsencrypt-production
|
||||||
|
solvers:
|
||||||
|
- dns01:
|
||||||
|
cloudflare:
|
||||||
|
email: "${SECRET_CLUSTER_DOMAIN_EMAIL}"
|
||||||
|
apiTokenSecretRef:
|
||||||
|
name: cloudflare-secret
|
||||||
|
key: CLOUDFLARE_TOKEN
|
||||||
|
selector:
|
||||||
|
dnsZones: ["${SECRET_EXTERNAL_DOMAIN}"]
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/cert-manager.io/clusterissuer_v1.json
|
||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: ClusterIssuer
|
||||||
|
metadata:
|
||||||
|
name: letsencrypt-staging
|
||||||
|
spec:
|
||||||
|
acme:
|
||||||
|
server: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
|
email: "${SECRET_CLUSTER_DOMAIN_EMAIL}"
|
||||||
|
privateKeySecretRef:
|
||||||
|
name: letsencrypt-staging
|
||||||
|
solvers:
|
||||||
|
- dns01:
|
||||||
|
cloudflare:
|
||||||
|
email: "${SECRET_CLUSTER_DOMAIN_EMAIL}"
|
||||||
|
apiTokenSecretRef:
|
||||||
|
name: cloudflare-secret
|
||||||
|
key: CLOUDFLARE_TOKEN
|
||||||
|
selector:
|
||||||
|
dnsZones: ["${SECRET_EXTERNAL_DOMAIN}"]
|
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
@@ -23,21 +23,21 @@ spec:
|
|||||||
substitute:
|
substitute:
|
||||||
APP: *app
|
APP: *app
|
||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
name: cert-manager-webhook-ovh
|
name: &app cert-manager-issuers
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
spec:
|
spec:
|
||||||
targetNamespace: cert-manager
|
targetNamespace: cert-manager
|
||||||
commonMetadata:
|
commonMetadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: &app cert-manager
|
app.kubernetes.io/name: *app
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: cert-manager
|
- name: cert-manager
|
||||||
- name: external-secrets-stores
|
- name: external-secrets-stores
|
||||||
path: ./kubernetes/apps/cert-manager/cert-manager/webhook-ovh
|
path: ./kubernetes/apps/cert-manager/cert-manager/issuers
|
||||||
prune: true
|
prune: true
|
||||||
sourceRef:
|
sourceRef:
|
||||||
kind: GitRepository
|
kind: GitRepository
|
||||||
|
@@ -1,69 +0,0 @@
|
|||||||
---
|
|
||||||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2.json
|
|
||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: cert-manager-webhook-ovh
|
|
||||||
namespace: cert-manager
|
|
||||||
spec:
|
|
||||||
interval: 30m
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: cert-manager-webhook-ovh
|
|
||||||
version: 0.7.3
|
|
||||||
sourceRef:
|
|
||||||
kind: HelmRepository
|
|
||||||
name: cert-manager-webhook-ovh
|
|
||||||
namespace: flux-system
|
|
||||||
maxHistory: 2
|
|
||||||
install:
|
|
||||||
createNamespace: true
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
upgrade:
|
|
||||||
cleanupOnFail: true
|
|
||||||
remediation:
|
|
||||||
retries: 3
|
|
||||||
uninstall:
|
|
||||||
keepHistory: false
|
|
||||||
values:
|
|
||||||
configVersion: 0.0.1
|
|
||||||
podAnnotations:
|
|
||||||
reloader.stakater.com/auto: "true"
|
|
||||||
groupName: "${SECRET_DOMAIN}"
|
|
||||||
certManager:
|
|
||||||
namespace: cert-manager
|
|
||||||
serviceAccountName: cert-manager
|
|
||||||
issuers:
|
|
||||||
- name: letsencrypt-staging
|
|
||||||
create: true
|
|
||||||
kind: ClusterIssuer
|
|
||||||
acmeServerUrl: https://acme-staging-v02.api.letsencrypt.org/directory
|
|
||||||
email: "${SECRET_EXTERNAL_DOMAIN_EMAIL}"
|
|
||||||
ovhEndpointName: ovh-eu
|
|
||||||
ovhAuthenticationRef:
|
|
||||||
applicationKeyRef:
|
|
||||||
name: cert-manager-webhook-ovh-secret
|
|
||||||
key: applicationKey
|
|
||||||
applicationSecretRef:
|
|
||||||
name: cert-manager-webhook-ovh-secret
|
|
||||||
key: applicationSecret
|
|
||||||
consumerKeyRef:
|
|
||||||
name: cert-manager-webhook-ovh-secret
|
|
||||||
key: consumerKey
|
|
||||||
- name: letsencrypt-production
|
|
||||||
create: true
|
|
||||||
kind: ClusterIssuer
|
|
||||||
acmeServerUrl: https://acme-v02.api.letsencrypt.org/directory
|
|
||||||
email: "${SECRET_EXTERNAL_DOMAIN_EMAIL}"
|
|
||||||
ovhEndpointName: ovh-eu
|
|
||||||
ovhAuthenticationRef:
|
|
||||||
applicationKeyRef:
|
|
||||||
name: cert-manager-webhook-ovh-secret
|
|
||||||
key: applicationKey
|
|
||||||
applicationSecretRef:
|
|
||||||
name: cert-manager-webhook-ovh-secret
|
|
||||||
key: applicationSecret
|
|
||||||
consumerKeyRef:
|
|
||||||
name: cert-manager-webhook-ovh-secret
|
|
||||||
key: consumerKey
|
|
@@ -14,7 +14,7 @@ metadata:
|
|||||||
namespace: cert-manager
|
namespace: cert-manager
|
||||||
spec:
|
spec:
|
||||||
type: alertmanager
|
type: alertmanager
|
||||||
address: http://kube-prometheus-stack-alertmanager.monitoring:9093/api/v2/alerts/
|
address: http://kube-prometheus-stack-alertmanager.observability:9093/api/v2/alerts/
|
||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/notification.toolkit.fluxcd.io/alert_v1beta3.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/notification.toolkit.fluxcd.io/alert_v1beta3.json
|
||||||
apiVersion: notification.toolkit.fluxcd.io/v1beta3
|
apiVersion: notification.toolkit.fluxcd.io/v1beta3
|
||||||
|
@@ -0,0 +1,203 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/postgres-operator.crunchydata.com/postgrescluster_v1beta1.json
|
||||||
|
apiVersion: postgres-operator.crunchydata.com/v1beta1
|
||||||
|
kind: PostgresCluster
|
||||||
|
metadata:
|
||||||
|
name: &name postgres
|
||||||
|
spec:
|
||||||
|
postgresVersion: 17
|
||||||
|
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
crunchy-userinit.ramblurr.github.com/enabled: "true"
|
||||||
|
crunchy-userinit.ramblurr.github.com/superuser: postgres
|
||||||
|
|
||||||
|
patroni: # turn on sync writes to at least 1 other replica
|
||||||
|
dynamicConfiguration:
|
||||||
|
synchronous_mode: true
|
||||||
|
postgresql:
|
||||||
|
max_wal_size: 5GB
|
||||||
|
synchronous_commit: "on"
|
||||||
|
pg_hba:
|
||||||
|
- hostnossl authelia all 192.168.8.0/22 md5 # Needed because authelia does not support SSL yet
|
||||||
|
- hostssl all all all md5
|
||||||
|
parameters:
|
||||||
|
max_connections: 500
|
||||||
|
instances:
|
||||||
|
- name: postgres
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: crunchy-postgres
|
||||||
|
replicas: &replica 2
|
||||||
|
dataVolumeClaimSpec:
|
||||||
|
storageClassName: openebs-hostpath
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 80Gi
|
||||||
|
topologySpreadConstraints:
|
||||||
|
- maxSkew: 1
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
whenUnsatisfiable: DoNotSchedule
|
||||||
|
labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
postgres-operator.crunchydata.com/cluster: *name
|
||||||
|
postgres-operator.crunchydata.com/data: postgres
|
||||||
|
|
||||||
|
users:
|
||||||
|
# Superuser
|
||||||
|
- name: postgres
|
||||||
|
databases:
|
||||||
|
- postgres
|
||||||
|
options: SUPERUSER
|
||||||
|
password: &password
|
||||||
|
type: AlphaNumeric
|
||||||
|
# Applications
|
||||||
|
- name: authelia
|
||||||
|
databases:
|
||||||
|
- authelia
|
||||||
|
password: *password
|
||||||
|
- name: bazarr
|
||||||
|
databases:
|
||||||
|
- bazarr_main
|
||||||
|
- bazarr_log
|
||||||
|
password: *password
|
||||||
|
- name: ghostfolio
|
||||||
|
databases:
|
||||||
|
- ghostfolio
|
||||||
|
password: *password
|
||||||
|
- name: home-assistant
|
||||||
|
databases:
|
||||||
|
- home-assistant
|
||||||
|
password: *password
|
||||||
|
- name: joplin
|
||||||
|
databases:
|
||||||
|
- joplin
|
||||||
|
password: *password
|
||||||
|
- name: lldap
|
||||||
|
databases:
|
||||||
|
- lldap
|
||||||
|
password: *password
|
||||||
|
- name: lidarr
|
||||||
|
databases:
|
||||||
|
- lidarr_main
|
||||||
|
- lidarr_log
|
||||||
|
password: *password
|
||||||
|
- name: lychee
|
||||||
|
databases:
|
||||||
|
- lychee
|
||||||
|
password: *password
|
||||||
|
- name: outline
|
||||||
|
databases:
|
||||||
|
- outline
|
||||||
|
password: *password
|
||||||
|
- name: paperless
|
||||||
|
databases:
|
||||||
|
- paperless
|
||||||
|
password: *password
|
||||||
|
- name: prowlarr
|
||||||
|
databases:
|
||||||
|
- prowlarr_main
|
||||||
|
- prowlarr_logs
|
||||||
|
password: *password
|
||||||
|
- name: pushover-notifier
|
||||||
|
databases:
|
||||||
|
- pushover-notifier
|
||||||
|
password: *password
|
||||||
|
- name: radarr
|
||||||
|
databases:
|
||||||
|
- radarr_main
|
||||||
|
- radarr_log
|
||||||
|
password: *password
|
||||||
|
- name: sonarr
|
||||||
|
databases:
|
||||||
|
- sonarr_main
|
||||||
|
- sonarr_log
|
||||||
|
password: *password
|
||||||
|
- name: tandoor
|
||||||
|
databases:
|
||||||
|
- tandoor
|
||||||
|
password: *password
|
||||||
|
- name: vikunja
|
||||||
|
databases:
|
||||||
|
- vikunja
|
||||||
|
password: *password
|
||||||
|
backups:
|
||||||
|
pgbackrest:
|
||||||
|
configuration: &backupConfig
|
||||||
|
- secret:
|
||||||
|
name: crunchy-postgres-secret
|
||||||
|
global: &backupFlag
|
||||||
|
compress-type: bz2
|
||||||
|
compress-level: "9"
|
||||||
|
# Minio
|
||||||
|
repo1-block: y
|
||||||
|
repo1-bundle: y
|
||||||
|
repo1-path: /crunchy-pgo
|
||||||
|
repo1-retention-full: "30" # days
|
||||||
|
repo1-retention-full-type: time
|
||||||
|
repo1-s3-uri-style: path
|
||||||
|
manual:
|
||||||
|
repoName: repo1
|
||||||
|
options:
|
||||||
|
- --type=full
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: crunchy-postgres-backup
|
||||||
|
repos:
|
||||||
|
- name: repo1 # Minio
|
||||||
|
s3: &minio
|
||||||
|
bucket: crunchy-postgres-operator
|
||||||
|
endpoint: "s3.${SECRET_INTERNAL_DOMAIN}"
|
||||||
|
region: us-east-1
|
||||||
|
schedules:
|
||||||
|
full: 0 1 * * 0 # Sunday at 01:00
|
||||||
|
differential: 0 1 * * 1-6 # Mon-Sat at 01:00
|
||||||
|
incremental: 0 2-23 * * * # Every hour except 01:00
|
||||||
|
|
||||||
|
# dataSource:
|
||||||
|
# pgbackrest:
|
||||||
|
# stanza: "db"
|
||||||
|
# configuration: *backupConfig
|
||||||
|
# global: *backupFlag
|
||||||
|
# repo:
|
||||||
|
# name: "repo1"
|
||||||
|
# s3: *minio
|
||||||
|
|
||||||
|
monitoring:
|
||||||
|
pgmonitor:
|
||||||
|
exporter:
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 64M
|
||||||
|
limits:
|
||||||
|
memory: 512M
|
||||||
|
|
||||||
|
proxy:
|
||||||
|
pgBouncer:
|
||||||
|
port: 5432
|
||||||
|
service:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
lbipam.cilium.io/ips: ${CLUSTER_LB_POSTGRES}
|
||||||
|
type: LoadBalancer
|
||||||
|
replicas: *replica
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: crunchy-postgres-pgbouncer
|
||||||
|
config:
|
||||||
|
global:
|
||||||
|
pool_mode: session # Grafana requires session https://github.com/grafana/grafana/issues/74260#issuecomment-1702795311. Everything else is happy with transaction
|
||||||
|
client_tls_sslmode: prefer
|
||||||
|
default_pool_size: "100"
|
||||||
|
max_client_conn: "500"
|
||||||
|
topologySpreadConstraints:
|
||||||
|
- maxSkew: 1
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
whenUnsatisfiable: DoNotSchedule
|
||||||
|
labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
postgres-operator.crunchydata.com/cluster: *name
|
||||||
|
postgres-operator.crunchydata.com/role: pgbouncer
|
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/external-secrets.io/externalsecret_v1beta1.json
|
||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: crunchy-postgres
|
||||||
|
spec:
|
||||||
|
refreshInterval: 5m
|
||||||
|
secretStoreRef:
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
name: onepassword-connect
|
||||||
|
target:
|
||||||
|
name: crunchy-postgres-secret
|
||||||
|
template:
|
||||||
|
engineVersion: v2
|
||||||
|
data:
|
||||||
|
s3.conf: |
|
||||||
|
[global]
|
||||||
|
repo1-s3-key={{ .CRUNCHY_POSTGRES_S3_ACCESS_KEY }}
|
||||||
|
repo1-s3-key-secret={{ .CRUNCHY_POSTGRES_S3_SECRET_KEY }}
|
||||||
|
encryption.conf: |
|
||||||
|
[global]
|
||||||
|
repo1-cipher-pass={{ .CRUNCHY_POSTGRES_BACKUP_ENCRYPTION_CIPHER }}
|
||||||
|
dataFrom:
|
||||||
|
- extract:
|
||||||
|
key: crunchy-postgres
|
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./externalsecret.yaml
|
||||||
|
- ./cluster.yaml
|
||||||
|
- ./podmonitor.yaml
|
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: PodMonitor
|
||||||
|
metadata:
|
||||||
|
name: cpgo-postgres
|
||||||
|
spec:
|
||||||
|
jobLabel: cpgo-postgres
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- database
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- honorLabels: true
|
||||||
|
path: /metrics
|
||||||
|
port: exporter
|
||||||
|
relabelings:
|
||||||
|
- sourceLabels:
|
||||||
|
[
|
||||||
|
"__meta_kubernetes_namespace",
|
||||||
|
"__meta_kubernetes_pod_label_postgres_operator_crunchydata_com_cluster",
|
||||||
|
]
|
||||||
|
targetLabel: pg_cluster
|
||||||
|
separator: "/"
|
||||||
|
replacement: "$1$2"
|
||||||
|
- sourceLabels:
|
||||||
|
[
|
||||||
|
__meta_kubernetes_pod_label_postgres_operator_crunchydata_com_instance,
|
||||||
|
]
|
||||||
|
targetLabel: deployment
|
||||||
|
- sourceLabels:
|
||||||
|
[__meta_kubernetes_pod_label_postgres_operator_crunchydata_com_role]
|
||||||
|
targetLabel: role
|
||||||
|
- sourceLabels: [__meta_kubernetes_pod_name]
|
||||||
|
targetLabel: instance
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
postgres-operator.crunchydata.com/cluster: postgres
|
||||||
|
postgres-operator.crunchydata.com/crunchy-postgres-exporter: "true"
|
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
metadata:
|
||||||
|
name: crunchy-pgo-secrets
|
||||||
|
spec:
|
||||||
|
provider:
|
||||||
|
kubernetes:
|
||||||
|
remoteNamespace: database
|
||||||
|
server:
|
||||||
|
caProvider:
|
||||||
|
type: ConfigMap
|
||||||
|
name: kube-root-ca.crt
|
||||||
|
namespace: database
|
||||||
|
key: ca.crt
|
||||||
|
auth:
|
||||||
|
serviceAccount:
|
||||||
|
name: external-secrets-pg
|
||||||
|
namespace: database
|
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./rbac.yaml
|
||||||
|
- ./clustersecretstore.yaml
|
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: external-secrets-pg
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["secrets"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["authorization.k8s.io"]
|
||||||
|
resources: ["selfsubjectrulesreviews"]
|
||||||
|
verbs: ["create"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: &name external-secrets-pg
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: *name
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: *name
|
||||||
|
namespace: database
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: external-secrets-pg
|
||||||
|
namespace: database
|
110
kubernetes/apps/database/crunchy-postgres-operator/ks.yaml
Normal file
110
kubernetes/apps/database/crunchy-postgres-operator/ks.yaml
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app crunchy-postgres-operator
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: database
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
interval: 30m
|
||||||
|
timeout: 5m
|
||||||
|
path: ./kubernetes/apps/database/crunchy-postgres-operator/operator
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: home-ops-kubernetes
|
||||||
|
wait: true
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app crunchy-postgres-operator-cluster
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: database
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
interval: 30m
|
||||||
|
timeout: 5m
|
||||||
|
path: ./kubernetes/apps/database/crunchy-postgres-operator/cluster
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: home-ops-kubernetes
|
||||||
|
wait: true
|
||||||
|
dependsOn:
|
||||||
|
- name: crunchy-postgres-operator
|
||||||
|
- name: external-secrets-stores
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app crunchy-postgres-operator-secretstore
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: database
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
interval: 30m
|
||||||
|
timeout: 5m
|
||||||
|
path: ./kubernetes/apps/database/crunchy-postgres-operator/clustersecretstore
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: home-ops-kubernetes
|
||||||
|
wait: true
|
||||||
|
dependsOn:
|
||||||
|
- name: crunchy-postgres-operator-cluster
|
||||||
|
- name: external-secrets
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app crunchy-postgres-userinit-controller
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: database
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
interval: 30m
|
||||||
|
timeout: 5m
|
||||||
|
path: ./kubernetes/apps/database/crunchy-postgres-operator/userinit-controller
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: home-ops-kubernetes
|
||||||
|
wait: true
|
||||||
|
dependsOn:
|
||||||
|
- name: crunchy-postgres-operator-cluster
|
||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app crunchy-postgres-pgadmin
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
targetNamespace: database
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
interval: 30m
|
||||||
|
timeout: 5m
|
||||||
|
path: ./kubernetes/apps/database/crunchy-postgres-operator/pgadmin
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: home-ops-kubernetes
|
||||||
|
wait: true
|
||||||
|
dependsOn:
|
||||||
|
- name: crunchy-postgres-operator-cluster
|
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2.json
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: crunchy-postgres-operator
|
||||||
|
spec:
|
||||||
|
interval: 30m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: pgo
|
||||||
|
version: 5.7.2
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: crunchydata
|
||||||
|
namespace: flux-system
|
||||||
|
interval: 5m
|
||||||
|
install:
|
||||||
|
crds: CreateReplace
|
||||||
|
upgrade:
|
||||||
|
crds: CreateReplace
|
||||||
|
dependsOn:
|
||||||
|
- name: openebs
|
||||||
|
namespace: openebs-system
|
||||||
|
values:
|
||||||
|
install:
|
||||||
|
clusterLabels:
|
||||||
|
app.kubernetes.io/name: pgo
|
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./helmrelease.yaml
|
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
|
||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: pgadmin
|
||||||
|
spec:
|
||||||
|
secretStoreRef:
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
name: onepassword-connect
|
||||||
|
target:
|
||||||
|
name: pgadmin-secret
|
||||||
|
template:
|
||||||
|
engineVersion: v2
|
||||||
|
data:
|
||||||
|
# App
|
||||||
|
PGADMIN_PASSWORD: "{{ .password }}"
|
||||||
|
dataFrom:
|
||||||
|
- extract:
|
||||||
|
key: pgadmin
|
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
# trunk-ignore(checkov/CKV_K8S_21)
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: pgadmin
|
||||||
|
annotations:
|
||||||
|
hajimari.io/icon: mdi:database
|
||||||
|
gethomepage.dev/enabled: "true"
|
||||||
|
gethomepage.dev/name: pgAdmin
|
||||||
|
gethomepage.dev/description: PostgreSQL management tool.
|
||||||
|
gethomepage.dev/group: Infrrastructure
|
||||||
|
gethomepage.dev/icon: pgadmin.png
|
||||||
|
gethomepage.dev/pod-selector: >-
|
||||||
|
app in (
|
||||||
|
pgadmin
|
||||||
|
)
|
||||||
|
spec:
|
||||||
|
ingressClassName: internal
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- &host pgadmin.${SECRET_EXTERNAL_DOMAIN}
|
||||||
|
rules:
|
||||||
|
- host: *host
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: pgadmin
|
||||||
|
port:
|
||||||
|
number: 5050
|
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./externalsecret.yaml
|
||||||
|
- ./ingress.yaml
|
||||||
|
- ./pgadmin.yaml
|
||||||
|
- ./service.yaml
|
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
apiVersion: postgres-operator.crunchydata.com/v1beta1
|
||||||
|
kind: PGAdmin
|
||||||
|
metadata:
|
||||||
|
name: pgadmin
|
||||||
|
spec:
|
||||||
|
users:
|
||||||
|
- username: admin@homelab.io
|
||||||
|
role: Administrator
|
||||||
|
passwordRef:
|
||||||
|
name: pgadmin-secret
|
||||||
|
key: PGADMIN_PASSWORD
|
||||||
|
dataVolumeClaimSpec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
serverGroups:
|
||||||
|
- name: supply
|
||||||
|
postgresClusterSelector: {}
|
||||||
|
serviceName: pgadmin
|
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
# trunk-ignore(checkov/CKV_K8S_21)
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: pgadmin
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
ports:
|
||||||
|
- name: pgadmin-port
|
||||||
|
port: 5050
|
||||||
|
protocol: TCP
|
||||||
|
selector:
|
||||||
|
postgres-operator.crunchydata.com/pgadmin: pgadmin
|
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2.json
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: userinit-controller
|
||||||
|
spec:
|
||||||
|
interval: 30m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: crunchy-userinit-controller
|
||||||
|
version: 0.0.4
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: crunchy-userinit
|
||||||
|
values:
|
||||||
|
fullnameOverride: crunchy-userinit-controller
|
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/source.toolkit.fluxcd.io/helmrepository_v1.json
|
||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: crunchy-userinit
|
||||||
|
spec:
|
||||||
|
interval: 30m
|
||||||
|
url: https://ramblurr.github.io/crunchy-userinit-controller
|
||||||
|
timeout: 3m
|
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./helmrepository.yaml
|
||||||
|
- ./helmrelease.yaml
|
@@ -4,7 +4,6 @@ apiVersion: external-secrets.io/v1beta1
|
|||||||
kind: ExternalSecret
|
kind: ExternalSecret
|
||||||
metadata:
|
metadata:
|
||||||
name: emqx
|
name: emqx
|
||||||
namespace: default
|
|
||||||
spec:
|
spec:
|
||||||
secretStoreRef:
|
secretStoreRef:
|
||||||
kind: ClusterSecretStore
|
kind: ClusterSecretStore
|
@@ -4,7 +4,6 @@ apiVersion: helm.toolkit.fluxcd.io/v2
|
|||||||
kind: HelmRelease
|
kind: HelmRelease
|
||||||
metadata:
|
metadata:
|
||||||
name: emqx
|
name: emqx
|
||||||
namespace: default
|
|
||||||
spec:
|
spec:
|
||||||
interval: 30m
|
interval: 30m
|
||||||
chart:
|
chart:
|
||||||
@@ -37,12 +36,12 @@ spec:
|
|||||||
EMQX_DASHBOARD__DEFAULT_USERNAME: admin
|
EMQX_DASHBOARD__DEFAULT_USERNAME: admin
|
||||||
service:
|
service:
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
loadBalancerIP: 192.168.169.109
|
loadBalancerIP: ${CLUSTER_LB_EMQX}
|
||||||
externalTrafficPolicy: Local
|
externalTrafficPolicy: Local
|
||||||
ingress:
|
ingress:
|
||||||
dashboard:
|
dashboard:
|
||||||
enabled: true
|
enabled: true
|
||||||
ingressClassName: nginx
|
ingressClassName: internal
|
||||||
annotations:
|
annotations:
|
||||||
hajimari.io/appName: "EMQX"
|
hajimari.io/appName: "EMQX"
|
||||||
hajimari.io/icon: simple-icons:eclipsemosquitto
|
hajimari.io/icon: simple-icons:eclipsemosquitto
|
||||||
@@ -63,17 +62,6 @@ spec:
|
|||||||
enabled: true
|
enabled: true
|
||||||
storageClass: rook-ceph-block
|
storageClass: rook-ceph-block
|
||||||
size: 400Mi
|
size: 400Mi
|
||||||
affinity:
|
|
||||||
podAntiAffinity:
|
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
- weight: 100
|
|
||||||
podAffinityTerm:
|
|
||||||
labelSelector:
|
|
||||||
matchExpressions:
|
|
||||||
- key: app.kubernetes.io/name
|
|
||||||
operator: In
|
|
||||||
values: ["emqx"]
|
|
||||||
topologyKey: kubernetes.io/hostname
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
@@ -2,7 +2,6 @@
|
|||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namespace: default
|
|
||||||
resources:
|
resources:
|
||||||
- ./externalsecret.yaml
|
- ./externalsecret.yaml
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
@@ -1,19 +1,19 @@
|
|||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
name: &app emqx
|
name: &app emqx
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
spec:
|
spec:
|
||||||
targetNamespace: default
|
targetNamespace: database
|
||||||
commonMetadata:
|
commonMetadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: *app
|
app.kubernetes.io/name: *app
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: rook-ceph-cluster
|
- name: rook-ceph-cluster
|
||||||
- name: external-secrets-stores
|
- name: external-secrets-stores
|
||||||
path: ./kubernetes/apps/default/emqx/app
|
path: ./kubernetes/apps/database/emqx/app
|
||||||
prune: true
|
prune: true
|
||||||
sourceRef:
|
sourceRef:
|
||||||
kind: GitRepository
|
kind: GitRepository
|
@@ -6,7 +6,7 @@ resources:
|
|||||||
# Pre Flux-Kustomizations
|
# Pre Flux-Kustomizations
|
||||||
- ./namespace.yaml
|
- ./namespace.yaml
|
||||||
# Flux-Kustomizations
|
# Flux-Kustomizations
|
||||||
- ./cloudnative-pg/ks.yaml
|
- ./crunchy-postgres-operator/ks.yaml
|
||||||
- ./dragonfly/ks.yaml
|
- ./dragonfly/ks.yaml
|
||||||
|
- ./emqx/ks.yaml
|
||||||
- ./influx/ks.yaml
|
- ./influx/ks.yaml
|
||||||
- ./pgadmin/ks.yaml
|
|
||||||
|
@@ -14,7 +14,7 @@ metadata:
|
|||||||
namespace: database
|
namespace: database
|
||||||
spec:
|
spec:
|
||||||
type: alertmanager
|
type: alertmanager
|
||||||
address: http://kube-prometheus-stack-alertmanager.monitoring:9093/api/v2/alerts/
|
address: http://kube-prometheus-stack-alertmanager.observability:9093/api/v2/alerts/
|
||||||
---
|
---
|
||||||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/notification.toolkit.fluxcd.io/alert_v1beta3.json
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/notification.toolkit.fluxcd.io/alert_v1beta3.json
|
||||||
apiVersion: notification.toolkit.fluxcd.io/v1beta3
|
apiVersion: notification.toolkit.fluxcd.io/v1beta3
|
||||||
|
@@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
|
|
||||||
apiVersion: external-secrets.io/v1beta1
|
|
||||||
kind: ExternalSecret
|
|
||||||
metadata:
|
|
||||||
name: atuin
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
secretStoreRef:
|
|
||||||
kind: ClusterSecretStore
|
|
||||||
name: onepassword-connect
|
|
||||||
target:
|
|
||||||
name: atuin-secret
|
|
||||||
template:
|
|
||||||
engineVersion: v2
|
|
||||||
data:
|
|
||||||
# App
|
|
||||||
ATUIN_DB_URI: "postgres://{{ .POSTGRES_USER }}:{{ .POSTGRES_PASS }}@postgres16-rw.database.svc.cluster.local/atuin"
|
|
||||||
# Postgres Init
|
|
||||||
INIT_POSTGRES_DBNAME: atuin
|
|
||||||
INIT_POSTGRES_HOST: postgres16-rw.database.svc.cluster.local
|
|
||||||
INIT_POSTGRES_USER: "{{ .POSTGRES_USER }}"
|
|
||||||
INIT_POSTGRES_PASS: "{{ .POSTGRES_PASS }}"
|
|
||||||
INIT_POSTGRES_SUPER_PASS: "{{ .POSTGRES_SUPER_PASS }}"
|
|
||||||
dataFrom:
|
|
||||||
- extract:
|
|
||||||
key: atuin
|
|
||||||
- extract:
|
|
||||||
key: cloudnative-pg
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user