Skip to content

Commit

Permalink
refactors: midarr's helm release also adds
Browse files Browse the repository at this point in the history
gatus, externalsecret
  • Loading branch information
axeII committed Jan 24, 2024
1 parent e73532a commit f01a129
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 4 deletions.
44 changes: 44 additions & 0 deletions kubernetes/apps/media/midarr/app/externalsecret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/axeII/crds/main/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: midarr
namespace: media
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: midarr-secret
creationPolicy: Owner
template:
engineVersion: v2
data:
# App
SETUP_ADMIN_EMAIL: "{{ .SETUP_ADMIN_EMAIL }}"
SETUP_ADMIN_NAME: "{{ .SETUP_ADMIN_NAME }}"
SETUP_ADMIN_PASSWORD: "{{ .SETUP_ADMIN_PASSWORD }}"
RADARR_API_KEY: "{{ .RADARR__API_KEY }}"
SONARR_API_KEY: "{{ .SONARR__API_KEY }}"
DB_HOSTNAME: &dbHost postgresql.database.svc.cluster.local
DB_DATABASE: &dbName midarr
DB_USERNAME: &dbUser "{{ .DB_USERNAME }}"
DB_PASSWORD: &dbPass "{{ .DB_PASSWORD }}"
# Postgres Init
INIT_POSTGRES_DBNAME: *dbName
INIT_POSTGRES_HOST: *dbHost
INIT_POSTGRES_USER: *dbUser
INIT_POSTGRES_PASS: *dbPass
INIT_POSTGRES_SUPER_PASS: "{{ .POSTGRES_SUPER_PASS }}"
dataFrom:
- extract:
key: midarr
- extract:
key: cloudnative-pg
- extract:
key: radarr
property: RADARR__API_KEY
- extract:
key: sonarr
property: SONARR__API_KEY
22 changes: 22 additions & 0 deletions kubernetes/apps/media/midarr/app/gatus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: midarr-gatus-ep
namespace: monitoring
labels:
gatus.io/enabled: "true"
data:
config.yaml: |
endpoints:
- name: midarr
url: https://midarr.${SECRET_DOMAIN}
group: media
interval: 1m
conditions: ["[STATUS] == 200"]
client:
dns-resolver: udp://192.168.69.106:53
alerts:
- type: discord
description: "healthcheck failed"
send-on-resolved: true
4 changes: 2 additions & 2 deletions kubernetes/apps/media/midarr/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
version: 1.5.1
sourceRef:
kind: HelmRepository
name: bjw-s
name: bjw-s-charts
namespace: flux-system
maxHistory: 2
install:
Expand Down Expand Up @@ -40,7 +40,7 @@ spec:
reloader.stakater.com/auto: "true"
image:
repository: ghcr.io/midarrlabs/midarr-server
tag: v3.1.0-beta.2
tag: v4.2.0@sha256:b368f94a8a7e0657125da108129ffbdc92d04fc7fba302ea88d9396b125b4d03
env:
TZ: ${TIMEZONE}
APP_URL: http://midarr.media.svc.cluster.local:4000
Expand Down
3 changes: 2 additions & 1 deletion kubernetes/apps/media/midarr/app/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
# - ./secret.sops.yaml
- ./externalsecret.yaml
- ./gatus.yaml
2 changes: 1 addition & 1 deletion kubernetes/apps/media/midarr/ks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cluster-apps-sonarr
name: cluster-apps-midarr
namespace: flux-system
spec:
dependsOn:
Expand Down

0 comments on commit f01a129

Please sign in to comment.