Migrate radarr to main postgres server.

This commit is contained in:
Joseph Hanson 2024-04-10 12:22:02 -05:00
parent 27cb238e3e
commit 3e632fd68b
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
5 changed files with 34 additions and 104 deletions

View file

@ -113,3 +113,33 @@ spec:
remoteRef: remoteRef:
remoteKey: sonarr remoteKey: sonarr
property: SONARR__POSTGRES_PASSWORD property: SONARR__POSTGRES_PASSWORD
---
# yaml-language-server: $schema=https://ks.hsn.dev/external-secrets.io/pushsecret_v1alpha1.json
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
name: radarr
spec:
refreshInterval: 1h
secretStoreRefs:
- name: onepassword-connect
kind: ClusterSecretStore
selector:
secret:
name: postgres-pguser-radarr
data:
- match:
secretKey: host
remoteRef:
remoteKey: radarr
property: RADARR__POSTGRES_HOST
- match:
secretKey: user
remoteRef:
remoteKey: radarr
property: RADARR__POSTGRES_USER
- match:
secretKey: password
remoteRef:
remoteKey: radarr
property: RADARR__POSTGRES_PASSWORD

View file

@ -16,6 +16,9 @@ spec:
RADARR__API_KEY: "{{ .api_key }}" RADARR__API_KEY: "{{ .api_key }}"
PUSHOVER_TOKEN: "{{ .radarr_token }}" PUSHOVER_TOKEN: "{{ .radarr_token }}"
PUSHOVER_USER_KEY: "{{ .userkey_jahanson }}" PUSHOVER_USER_KEY: "{{ .userkey_jahanson }}"
RADARR__POSTGRES_HOST: "{{ .RADARR__POSTGRES_HOST }}"
RADARR__POSTGRES_USER: "{{ .RADARR__POSTGRES_USER }}"
RADARR__POSTGRES_PASSWORD: "{{ .RADARR__POSTGRES_PASSWORD }}"
dataFrom: dataFrom:
- extract: - extract:
key: pushover key: pushover

View file

@ -46,22 +46,7 @@ spec:
RADARR__PORT: &port 80 RADARR__PORT: &port 80
RADARR__LOG_LEVEL: info RADARR__LOG_LEVEL: info
RADARR__THEME: dark RADARR__THEME: dark
RADARR__POSTGRES_HOST:
valueFrom:
secretKeyRef:
name: "${APP}-pguser-${DB_USER}"
key: host
RADARR__POSTGRES_PORT: "5432" RADARR__POSTGRES_PORT: "5432"
RADARR__POSTGRES_USER:
valueFrom:
secretKeyRef:
name: "${APP}-pguser-${DB_USER}"
key: user
RADARR__POSTGRES_PASSWORD:
valueFrom:
secretKeyRef:
name: "${APP}-pguser-${DB_USER}"
key: password
RADARR__POSTGRES_MAIN_DB: radarr_main RADARR__POSTGRES_MAIN_DB: radarr_main
RADARR__POSTGRES_LOG_DB: radarr_logs RADARR__POSTGRES_LOG_DB: radarr_logs
TZ: America/Chicago TZ: America/Chicago

View file

@ -4,7 +4,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ./externalsecret.yaml - ./externalsecret.yaml
- ./postgresCluster.yaml
- ./pvc.yaml - ./pvc.yaml
- ./helmrelease.yaml - ./helmrelease.yaml
configMapGenerator: configMapGenerator:

View file

@ -1,87 +0,0 @@
---
# yaml-language-server: $schema=https://ks.hsn.dev/postgres-operator.crunchydata.com/postgrescluster_v1beta1.json
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: "${APP}"
spec:
postgresVersion: 16
dataSource:
pgbackrest:
stanza: db
configuration:
- secret:
name: pgo-s3-creds
global:
repo1-path: "/${APP}/repo1"
repo1-s3-uri-style: path
repo:
name: repo1
s3:
bucket: "crunchy-postgres"
endpoint: "s3.hsn.dev"
region: "us-east-1"
patroni:
dynamicConfiguration:
synchronous_mode: true
postgresql:
synchronous_commit: "on"
pg_hba:
- hostnossl all all 10.32.0.0/16 md5
- hostssl all all all md5
instances:
- name: postgres
metadata:
labels:
app.kubernetes.io/name: pgo-${APP}
replicas: 2
dataVolumeClaimSpec:
storageClassName: openebs-hostpath
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "kubernetes.io/hostname"
whenUnsatisfiable: "DoNotSchedule"
labelSelector:
matchLabels:
postgres-operator.crunchydata.com/cluster: ${APP}
postgres-operator.crunchydata.com/data: postgres
users:
- name: "${DB_USER}"
databases:
- "radarr_main"
- "radarr_logs"
options: "SUPERUSER"
password:
type: AlphaNumeric
backups:
pgbackrest:
configuration:
- secret:
name: pgo-s3-creds
global:
archive-push-queue-max: 4GiB
repo1-retention-full: "14"
repo1-retention-full-type: time
repo1-path: "/${APP}/repo1"
repo1-s3-uri-style: path
manual:
repoName: repo1
options:
- --type=full
metadata:
labels:
app.kubernetes.io/name: pgo-${APP}-backup
repos:
- name: repo1
schedules:
full: "0 1 * * 0"
differential: "0 1 * * 1-6"
s3:
bucket: "crunchy-postgres"
endpoint: "s3.hsn.dev"
region: "us-east-1"