add periodic cj that updates wrongmove data [ci skip]

This commit is contained in:
Viktor Barzin 2025-06-01 21:06:02 +00:00
parent 8bca25f953
commit b0ceb7efbe

View file

@ -20,7 +20,7 @@ resource "kubernetes_deployment" "realestate-crawler-ui" {
name = "realestate-crawler-ui"
namespace = "realestate-crawler"
labels = {
app = "realestate-crawler-ui"
app = "realestate-crawler-ui"
}
}
spec {
@ -69,7 +69,7 @@ resource "kubernetes_service" "realestate-crawler" {
app = "realestate-crawler-ui"
}
port {
port = "80"
port = "80"
}
}
}
@ -83,52 +83,52 @@ module "ingress" {
# resource "kubernetes_cron_job_v1" "scrape-rightmove" {
# metadata {
# name = "scrape-rightmove"
# namespace = "realestate-crawler"
# }
# spec {
# concurrency_policy = "Replace"
# failed_jobs_history_limit = 5
# schedule = "0 0 * * *"
# starting_deadline_seconds = 10
# successful_jobs_history_limit = 10
# job_template {
# metadata {}
# spec {
# backoff_limit = 3
# ttl_seconds_after_finished = 10
# template {
# metadata {}
# spec {
# container {
# name = "postgresql-backup"
# image = "postgres:16.4-bullseye"
# command = ["/bin/sh", "-c", <<-EOT
# export now=$(date +"%Y_%m_%d_%H_%M")
# PGPASSWORD=${var.postgresql_password} pg_dumpall -h immich-postgresql -U immich > /backup/dump_$now.sql
resource "kubernetes_cron_job_v1" "scrape-rightmove" {
metadata {
name = "scrape-rightmove"
namespace = "realestate-crawler"
}
spec {
concurrency_policy = "Replace"
failed_jobs_history_limit = 5
schedule = "0 0 * * *"
starting_deadline_seconds = 10
successful_jobs_history_limit = 10
job_template {
metadata {}
spec {
backoff_limit = 3
ttl_seconds_after_finished = 10
template {
metadata {}
spec {
container {
name = "scrape-rightmove"
image = "viktorbarzin/realestatecrawler:latest"
# command = ["/bin/sh", "-c", <<-EOT
# export now=$(date +"%Y_%m_%d_%H_%M")
# PGPASSWORD=${var.postgresql_password} pg_dumpall -h immich-postgresql -U immich > /backup/dump_$now.sql
# # Rotate - delete last log file
# cd /backup
# find . -name "dump_*.sql" -type f -mtime +14 -delete # 14 day retention of backups
# EOT
# ]
# volume_mount {
# name = "postgresql-backup"
# mount_path = "/backup"
# }
# }
# volume {
# name = "postgresql-backup"
# nfs {
# path = "/mnt/main/immich/data-immich-postgresql"
# server = "10.0.10.15"
# }
# }
# }
# }
# }
# }
# }
# }
# # Rotate - delete last log file
# cd /backup
# find . -name "dump_*.sql" -type f -mtime +14 -delete # 14 day retention of backups
# EOT
# ]
volume_mount {
name = "data"
mount_path = "/app/data"
}
}
volume {
name = "data"
nfs {
path = "/mnt/main/real-estate-crawler"
server = "10.0.10.15"
}
}
}
}
}
}
}
}