use geoapify in dawarich instead of local photon [ci skip]

This commit is contained in:
Viktor Barzin 2025-05-31 21:50:16 +00:00
parent 1cc4482eb2
commit 7b974c387f
3 changed files with 102 additions and 80 deletions

View file

@ -98,6 +98,7 @@ variable "cloudflare_non_proxied_names" {}
variable "cloudflare_tunnel_token" {} variable "cloudflare_tunnel_token" {}
variable "owntracks_credentials" {} variable "owntracks_credentials" {}
variable "dawarich_database_password" {} variable "dawarich_database_password" {}
variable "geoapify_api_key" {}
variable "tandoor_database_password" {} variable "tandoor_database_password" {}
variable "n8n_postgresql_password" {} variable "n8n_postgresql_password" {}
@ -408,6 +409,7 @@ module "kubernetes_cluster" {
owntracks_credentials = var.owntracks_credentials owntracks_credentials = var.owntracks_credentials
dawarich_database_password = var.dawarich_database_password dawarich_database_password = var.dawarich_database_password
geoapify_api_key = var.geoapify_api_key
tandoor_database_password = var.tandoor_database_password tandoor_database_password = var.tandoor_database_password
tandoor_email_password = var.mailserver_accounts["info@viktorbarzin.me"] tandoor_email_password = var.mailserver_accounts["info@viktorbarzin.me"]

View file

@ -1,5 +1,6 @@
variable "tls_secret_name" {} variable "tls_secret_name" {}
variable "database_password" {} variable "database_password" {}
variable "geoapify_api_key" {}
resource "kubernetes_namespace" "dawarich" { resource "kubernetes_namespace" "dawarich" {
metadata { metadata {
@ -53,7 +54,7 @@ resource "kubernetes_deployment" "dawarich" {
spec { spec {
container { container {
image = "freikin/dawarich:latest" image = "freikin/dawarich:0.26.1"
name = "dawarich" name = "dawarich"
port { port {
name = "http" name = "http"
@ -118,9 +119,13 @@ resource "kubernetes_deployment" "dawarich" {
value = "0.0.0.0" value = "0.0.0.0"
} }
env { env {
name = "PHOTON_API_HOST" name = "SELF_HOSTED"
value = "photon.dawarich" value = "true"
} }
# env {
# name = "PHOTON_API_HOST"
# value = "photon.dawarich"
# }
# volume_mount { # volume_mount {
@ -129,7 +134,7 @@ resource "kubernetes_deployment" "dawarich" {
# } # }
} }
container { container {
image = "freikin/dawarich:latest" image = "freikin/dawarich:0.26.1"
name = "dawarich-sidekiq" name = "dawarich-sidekiq"
command = ["sidekiq-entrypoint.sh"] command = ["sidekiq-entrypoint.sh"]
args = ["sidekiq"] args = ["sidekiq"]
@ -161,10 +166,6 @@ resource "kubernetes_deployment" "dawarich" {
name = "BACKGROUND_PROCESSING_CONCURRENCY" name = "BACKGROUND_PROCESSING_CONCURRENCY"
value = "10" value = "10"
} }
env {
name = "DISTANCE_UNIT"
value = "km"
}
env { env {
name = "ENABLE_TELEMETRY" name = "ENABLE_TELEMETRY"
value = "true" value = "true"
@ -181,9 +182,22 @@ resource "kubernetes_deployment" "dawarich" {
name = "PROMETHEUS_EXPORTER_HOST" name = "PROMETHEUS_EXPORTER_HOST"
value = "dawarich.dawarich" value = "dawarich.dawarich"
} }
# env {
# name = "PHOTON_API_HOST"
# value = "photon.dawarich:2322"
# # value = "photon.komoot.io"
# }
# env {
# name = "PHOTON_API_USE_HTTPS"
# value = "false"
# }
env { env {
name = "PHOTON_API_HOST" name = "GEOAPIFY_API_KEY"
value = "photon.dawarich" value = var.geoapify_api_key
}
env {
name = "SELF_HOSTED"
value = "true"
} }
# volume_mount { # volume_mount {
@ -197,57 +211,61 @@ resource "kubernetes_deployment" "dawarich" {
} }
resource "kubernetes_deployment" "photon" { # resource "kubernetes_deployment" "photon" {
metadata { # metadata {
name = "photon" # name = "photon"
namespace = "dawarich" # namespace = "dawarich"
labels = { # labels = {
app = "photon" # app = "photon"
} # }
} # }
spec { # spec {
replicas = 1 # replicas = 1
strategy { # strategy {
type = "Recreate" # type = "Recreate"
} # }
selector { # selector {
match_labels = { # match_labels = {
app = "photon" # app = "photon"
} # }
} # }
template { # template {
metadata { # metadata {
labels = { # labels = {
app = "photon" # app = "photon"
} # }
} # }
spec { # spec {
container { # container {
image = "thomasnordquist/photon-geocoder:latest" # image = "rtuszik/photon-docker:latest"
name = "photon" # name = "photon"
port { # port {
name = "tcp" # name = "tcp"
container_port = 2322 # container_port = 2322
} # }
# env {
# name = "COUNTRY_CODE"
# value = "bg"
# }
volume_mount { # volume_mount {
name = "data" # name = "data"
mount_path = "/photon/photon_data" # mount_path = "/photon/photon_data"
} # }
} # }
volume { # volume {
name = "data" # name = "data"
nfs { # nfs {
path = "/mnt/main/photon" # path = "/mnt/main/photon"
server = "10.0.10.15" # server = "10.0.10.15"
} # }
} # }
} # }
} # }
} # }
} # }
@ -273,27 +291,27 @@ resource "kubernetes_service" "dawarich" {
} }
} }
resource "kubernetes_service" "photon" { # resource "kubernetes_service" "photon" {
metadata { # metadata {
name = "photon" # name = "photon"
namespace = "dawarich" # namespace = "dawarich"
labels = { # labels = {
"app" = "photon" # "app" = "photon"
} # }
} # }
spec { # spec {
selector = { # selector = {
app = "photon" # app = "photon"
} # }
port { # port {
name = "http" # name = "http"
port = 2322 # port = 2322
target_port = 2322 # target_port = 2322
protocol = "TCP" # protocol = "TCP"
} # }
} # }
} # }
module "ingress" { module "ingress" {
source = "../ingress_factory" source = "../ingress_factory"
namespace = "dawarich" namespace = "dawarich"

View file

@ -77,6 +77,7 @@ variable "cloudflare_proxied_names" {}
variable "cloudflare_non_proxied_names" {} variable "cloudflare_non_proxied_names" {}
variable "owntracks_credentials" {} variable "owntracks_credentials" {}
variable "dawarich_database_password" {} variable "dawarich_database_password" {}
variable "geoapify_api_key" {}
variable "tandoor_database_password" {} variable "tandoor_database_password" {}
variable "tandoor_email_password" {} variable "tandoor_email_password" {}
variable "n8n_postgresql_password" {} variable "n8n_postgresql_password" {}
@ -595,6 +596,7 @@ module "dawarich" {
source = "./dawarich" source = "./dawarich"
tls_secret_name = var.tls_secret_name tls_secret_name = var.tls_secret_name
database_password = var.dawarich_database_password database_password = var.dawarich_database_password
geoapify_api_key = var.geoapify_api_key
} }
module "changedetection" { module "changedetection" {
@ -615,6 +617,6 @@ module "n8n" {
} }
module "real-estate-crawler" { module "real-estate-crawler" {
source = "./real-estate-crawler" source = "./real-estate-crawler"
tls_secret_name = var.tls_secret_name tls_secret_name = var.tls_secret_name
} }