From eff77aaf0839e6317a5900dbecbeb1b9d95e99c9 Mon Sep 17 00:00:00 2001 From: paulfantom Date: Tue, 7 Jan 2025 21:16:41 +0100 Subject: [PATCH] *: remove obsolete pics-mgmt solution --- apps/pics-mgmt/manifests/cronjob.yaml | 42 --------- apps/pics-mgmt/manifests/prometheusrules.yaml | 36 -------- apps/pics-mgmt/manifests/pv.yaml | 16 ---- apps/pics-mgmt/manifests/pvc.yaml | 13 --- apps/pics-mgmt/manifests/script.yaml | 92 ------------------- apps/pics-mgmt/script.sh | 85 ----------------- base/flux-apps/pics-mgmt.yaml | 13 --- 7 files changed, 297 deletions(-) delete mode 100644 apps/pics-mgmt/manifests/cronjob.yaml delete mode 100644 apps/pics-mgmt/manifests/prometheusrules.yaml delete mode 100644 apps/pics-mgmt/manifests/pv.yaml delete mode 100644 apps/pics-mgmt/manifests/pvc.yaml delete mode 100644 apps/pics-mgmt/manifests/script.yaml delete mode 100644 apps/pics-mgmt/script.sh delete mode 100644 base/flux-apps/pics-mgmt.yaml diff --git a/apps/pics-mgmt/manifests/cronjob.yaml b/apps/pics-mgmt/manifests/cronjob.yaml deleted file mode 100644 index 0a674f4bf..000000000 --- a/apps/pics-mgmt/manifests/cronjob.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: batch/v1 -kind: CronJob -metadata: - name: manager - namespace: pics-mgmt -spec: - suspend: true - schedule: "59 23 7 * *" - concurrencyPolicy: Forbid - successfulJobsHistoryLimit: 2 - failedJobsHistoryLimit: 3 - jobTemplate: - spec: - template: - spec: - containers: - - name: manager - image: quay.io/paulfantom/exiftool:12.40-r0 - imagePullPolicy: IfNotPresent - command: - - /bin/bash - - -c - - /usr/local/bin/manager.sh /Multimedia/Camera\ Uploads /Multimedia/Uncut - env: - - name: PROM_PGW - value: pushgateway.monitoring.svc - volumeMounts: - - mountPath: /usr/local/bin/manager.sh - name: manager-bin - readOnly: true - subPath: manager.sh - - name: multimedia - mountPath: /Multimedia - restartPolicy: OnFailure - volumes: - - name: manager-bin - configMap: - name: manager - defaultMode: 0755 - - name: multimedia - persistentVolumeClaim: - claimName: multimedia diff --git a/apps/pics-mgmt/manifests/prometheusrules.yaml b/apps/pics-mgmt/manifests/prometheusrules.yaml deleted file mode 100644 index cd11e5ee1..000000000 --- a/apps/pics-mgmt/manifests/prometheusrules.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: PrometheusRule -metadata: - labels: - prometheus: k8s - role: alert-rules - name: pics-mgmt-alert-rules - namespace: pics-mgmt -spec: - groups: - - name: Pictures job completion alerts - rules: - - alert: JobNotCompleted - expr: | - ((time() - (pictures_job_success_timestamp_seconds > 0)) > pictures_job_max_age_seconds) - or - (time() - pictures_job_start_timestamp_seconds > pictures_job_max_age_seconds and pictures_job_success_timestamp_seconds == 0) - for: 1m - labels: - severity: warning - alert_type: symptom - annotations: - title: Pictures Job has not completed recently - description: > - The pictures job "{{ $labels.resource }}" has not started/completed in {{ $value | humanizeDuration }}. - runbook: https://runbooks.thaum.xyz/runbooks/thaum-xyz/job_completion - - alert: JobFailed - expr: pictures_job_failed == 1 - labels: - severity: warning - alert_type: symptom - annotations: - title: Pictures Job has failed - description: > - The pictures job "{{ $labels.job}}" resource "{{ $labels.resource }}" has failed. - runbook: https://runbooks.thaum.xyz/runbooks/thaum-xyz/job_completion diff --git a/apps/pics-mgmt/manifests/pv.yaml b/apps/pics-mgmt/manifests/pv.yaml deleted file mode 100644 index 4bb62411b..000000000 --- a/apps/pics-mgmt/manifests/pv.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: multimedia - namespace: pics-mgmt -spec: - accessModes: - - ReadWriteOnce - capacity: - storage: 4000Gi - nfs: - path: /Multimedia - server: 192.168.2.29 - persistentVolumeReclaimPolicy: Retain - storageClassName: manual - volumeMode: Filesystem diff --git a/apps/pics-mgmt/manifests/pvc.yaml b/apps/pics-mgmt/manifests/pvc.yaml deleted file mode 100644 index 45655be42..000000000 --- a/apps/pics-mgmt/manifests/pvc.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: multimedia - namespace: pics-mgmt -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 4000Gi - storageClassName: manual - volumeName: multimedia \ No newline at end of file diff --git a/apps/pics-mgmt/manifests/script.yaml b/apps/pics-mgmt/manifests/script.yaml deleted file mode 100644 index 067ea2604..000000000 --- a/apps/pics-mgmt/manifests/script.yaml +++ /dev/null @@ -1,92 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: manager - namespace: pics-mgmt -data: - manager.sh: |- - #!/bin/bash - - INPUT_DIR="$1" - OUTPUT_DIR="$2" - - PROM_PREFIX="pictures" - # MAX_AGE needs to account for job scheduling frequency and job runtime - PROM_MAX_AGE="2851200" # 2h - - # PROM_PGW="" - - set -euo pipefail - - metrics_reset() { - # Report start to the monitoring system - cat < ${createdate#;DateFmt("%s")}' \ - -d "${OUTPUT_DIR}/%Y/%m/%Y-%m-%d-%%f%%-c.%%e" \ - "-filename ${createdate#;DateFmt("%s")}' \ - -d "${OUTPUT_DIR}/%Y/%m/%Y-%m-%d-%%f%%-c.%%e" \ - "-filename