apartment-search

by janip81

Helm chartv0.2.0App 0.2.0Verified publisher

Self-hosted aggregator for Swedish rental apartment listings (Next.js + PostgreSQL)

About this chart

apartment-search

Self-hosted aggregator for Swedish rental apartment listings (Next.js + PostgreSQL)

Homepage: https://github.com/janip81/helm-charts/tree/main/charts/apartment-search

Maintainers

NameEmailUrl
janip81[email protected]https://github.com/janip81

Source Code

Overview

Helm chart for deploying apartment-search — a self-hosted aggregator for Swedish rental apartment listings.

One image serves three roles:

ResourcePurpose
Deployment <release>Next.js web app (UI, API, /health, /ready)
CronJob <release>-collectorCollector tick — runs every source that is due (per-source interval lives in the DB)
Job <release>-migrateprisma migrate deploy, once per deploy
ConfigMap <release>-configNon-secret env (env: values)
Secret <release>-secretOnly when secret.create: true; normally provided externally with key DATABASE_URL
HTTPRoute / IngressGateway API (default) or classic Ingress
CNPG Cluster <release>-pgOnly when cnpg.enabled: true (dedicated PostgreSQL with a PVC)

Adding this helm repository

helm repo add janip81 https://janip81.github.io/helm-charts/
helm search repo apartment-search

Migrations

Migrations never run per replica. A single Job runs prisma migrate deploy:

  • Argo CD: Sync hook at wave 1 — after Secrets/ConfigMaps (wave 0), before the Deployment and CronJob (wave 2).
  • Plain Helm: pre-install,pre-upgrade hook — the database Secret must already exist.

Secret Management (ArgoCD Vault Plugin)

secret:
  create: false
  name: apartment-search-secret
# cluster-config/apartment-search/secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: apartment-search-secret
  namespace: apartment-search
  annotations:
    avp.kubernetes.io/path: "kubernetes/data/prod-k8s/apartment-search"
type: Opaque
stringData:
  DATABASE_URL: <path:kubernetes/data/prod-k8s/apartment-search#database-url>

Values

KeyTypeDefaultDescription
affinityobject{}
cnpgobject{"database":"apartment_search","enabled":false,"imageName":"ghcr.io/cloudnative-pg/postgresql:16","instances":1,"owner":"apartment_search","storage":{"size":"5Gi","storageClass":""}}Dedicated CloudNativePG cluster for this app. Leave disabled to use a shared cluster (DATABASE_URL in the Secret).
cnpg.storage.sizestring"5Gi"PVC size — this is where listing data persists
cnpg.storage.storageClassstring""StorageClass (empty = cluster default)
collectorobject{"activeDeadlineSeconds":900,"concurrencyPolicy":"Forbid","enabled":true,"env":{},"failedJobsHistoryLimit":5,"resources":{"limits":{"memory":"384Mi"},"requests":{"cpu":"50m","memory":"128Mi"}},"schedule":"*/5 * * * *","startingDeadlineSeconds":120,"successfulJobsHistoryLimit":3,"suspend":false,"timeZone":"Europe/Stockholm"}Source collection. One CronJob "tick" runs every source that is due according to its own interval stored in the database — no per-source CronJobs.
collector.envobject{}Extra env for the collector only (e.g. MOCK_UNSTABLE_MODE)
collector.schedulestring"*/5 * * * *"Tick frequency (the finest per-source interval that can be honoured)
discoveryobject{"activeDeadlineSeconds":3600,"concurrencyPolicy":"Forbid","enabled":false,"failedJobsHistoryLimit":3,"limit":25,"resources":{"limits":{"memory":"384Mi"},"requests":{"cpu":"50m","memory":"128Mi"}},"schedule":"30 3 * * *","successfulJobsHistoryLimit":3,"timeZone":"Europe/Stockholm"}Landlord website discovery (registry). Only VERIFIED landlords whose last discovery is older than staleDays are crawled; public pages only, robots.txt obeyed, ~8 requests per landlord. Results are review candidates — nothing is activated automatically.
discovery.limitint25Max landlords per run
envobject{"DEFAULT_USER_EMAIL":"owner@localhost","HTTP_USER_AGENT":"apartment-search/0.1 (personal rental aggregator)","LOG_LEVEL":"info","NEXT_TELEMETRY_DISABLED":"1","NODE_ENV":"production","SOURCE_LEASE_MINUTES":"10"}Non-secret configuration, rendered into a ConfigMap and injected as env vars
env.DEFAULT_USER_EMAILstring"owner@localhost"Implicit single user until real authentication exists
env.HTTP_USER_AGENTstring"apartment-search/0.1 (personal rental aggregator)"User-Agent sent to apartment sources — identify yourself honestly
env.SOURCE_LEASE_MINUTESstring"10"Minutes a source execution lease is held before it is considered abandoned
fullnameOverridestring""
gatewayApi.enabledbooltrueExpose via Gateway API HTTPRoute
gatewayApi.hoststring"apartments.example.com"
gatewayApi.parentRefs[0].groupstring"gateway.networking.k8s.io"
gatewayApi.parentRefs[0].kindstring"Gateway"
gatewayApi.parentRefs[0].namestring"internal-shared"
gatewayApi.parentRefs[0].namespacestring"kube-system"
image.pullPolicystring"IfNotPresent"Image pull policy
image.repositorystring"ghcr.io/janip81/apartment-search"Image repository (one image serves web, collector and migrations)
image.tagstring"main"Image tag (pin to a git SHA in GitOps)
imagePullSecretslist[]Image pull secrets for private registries (e.g. ghcr.io)
ingress.annotationsobject{}
ingress.classNamestring""
ingress.enabledboolfalseClassic Ingress alternative to gatewayApi
ingress.hoststring"apartments.example.com"
ingress.tlslist[]
migrationsobject{"activeDeadlineSeconds":600,"backoffLimit":2,"enabled":true,"resources":{"limits":{"memory":"384Mi"},"requests":{"cpu":"50m","memory":"128Mi"}}}Prisma migrations run ONCE per deploy in a Job (never per replica). Argo CD: Sync hook at wave 1, after Secrets/ConfigMaps and before the Deployment/CronJob (wave 2). Plain Helm: pre-install/pre-upgrade hook (the DB Secret must already exist).
nameOverridestring""
nodeSelectorobject{}
podAnnotationsobject{}
podLabelsobject{}
podSecurityContext.fsGroupint1001
podSecurityContext.runAsGroupint1001
podSecurityContext.runAsNonRootbooltrue
podSecurityContext.runAsUserint1001
podSecurityContext.seccompProfile.typestring"RuntimeDefault"
probes.liveness.failureThresholdint3
probes.liveness.initialDelaySecondsint10
probes.liveness.pathstring"/health"
probes.liveness.periodSecondsint20
probes.liveness.timeoutSecondsint5
probes.readiness.failureThresholdint3
probes.readiness.initialDelaySecondsint5
probes.readiness.pathstring"/ready"
probes.readiness.periodSecondsint10
probes.readiness.timeoutSecondsint5
replicaCountint1Web replicas. Safe to scale: migrations run in a single Job and source runs use a DB lease.
resources.limits.memorystring"512Mi"
resources.requests.cpustring"100m"
resources.requests.memorystring"192Mi"
secretobject{"create":false,"name":""}Secret holding DATABASE_URL (and any future secrets). Never put real credentials in values.
secret.createboolfalseCreate the Secret from secretEnv. Keep false when it is managed externally (AVP/Vault via cluster-config).
secret.namestring""Name of the Secret (created or existing). Defaults to -secret.
secretEnvobject{"DATABASE_URL":""}Used only when secret.create is true (local/test installs)
securityContext.allowPrivilegeEscalationboolfalse
securityContext.capabilities.drop[0]string"ALL"
securityContext.readOnlyRootFilesystembooltrue
service.portint3000Service port (Next.js listens on 3000)
service.typestring"ClusterIP"Service type
tolerationslist[]

Autogenerated from chart metadata using helm-docs v1.14.2

Deploy apartment-search with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has apartment-search on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartapartment-search is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply