nominatim

by robjuz

Helm chartv6.5.1App 5.3.3

A Helm chart for Kubernetes

About this chart

Nominatim

Nominatim is a tool (an API) to search OSM data by name and address and to generate synthetic addresses of OSM points (reverse geocoding).

TL;DR

helm repo add robjuz https://robjuz.github.io/helm-charts/
helm install nominatim robjuz/nominatim

Introduction

This chart bootstraps a Nominatim deployment on a Kubernetes cluster using the Helm package manager.

It also packages a Bitnami PostgreSQL chart which is required for bootstrapping a PostgreSQL deployment for the database requirements of the Nominatim application.

This chart has been tested to work with NGINX Ingress and cert-manager on top of the MicroK8s.

Prerequisites

  • Kubernetes 1.12+ (ingress requires 1.19+)
  • Helm 3.1.0
  • PV provisioner support in the underlying infrastructure
  • ReadWriteMany volumes for deployment scaling and flatnode support

Installing the Chart

The installation consist of 2 steps

  1. Initialisation
  2. App deployment

Initialisation

SetinitJob.enabled: true

During the initialization, all required data are downloaded and the database is build. To improve the import speed you can set additional PostgreSQL params

initJob:
  enabled: true

postgresql:
  primary:
    extendedConfiguration: |
      shared_buffers = 2GB
      maintenance_work_mem = 10GB
      autovacuum_work_mem = 2GB
      work_mem = 50MB
      effective_cache_size = 24GB
      synchronous_commit = off
      max_wal_size = 1GB
      checkpoint_timeout = 10min
      checkpoint_completion_target = 0.9
      fsync = off
      full_page_writes = off

To install the chart with the release name nominatim:

helm upgrade --install nominatim robjuz/nominatim -f values.yaml

App deployment

You need to set initJob.enabled: false

You also should remove the postgresql.primary.extendedConfiguration

initJob:
  enabled: false

To install the chart with the release name nominatim:

helm upgrade --install nominatim robjuz/nominatim -f values.yaml

Uninstalling the Chart

To uninstall/delete the nominatim deployment:

helm delete nominatim

The command removes all the Kubernetes components associated with the chart and deletes the release, but the imported data still remains.

Removing persisted data

For a total uninstallation of nomination, a data removal is necessary. To do so, first of all, you need to search for the right persistence volume. To identify it, you need to type de command below, and search for a volume containing the helm release name.

kubectl get pvc

You'll receive an output similar to:

NAMESTATUSVOLUMECAPACITYACCESS MODESSTORAGECLASSAGE
data-nominatim-postgresql-0Boundpvc-b450c62d-d888-4869-9568-298e6d10b597500GiRWOstandard3d1h

Once you found the correct PVC, you just need to type de command to delete it:

kubectl delete pvc data-nominatim-postgresql-0

Or, you may use a single command for both operation, like following:

kubectl delete pvc -l app.kubernetes.io/instance=nominatim

Note: The command above may differ a little depending the k8s cluster version you're using.

Removing persisted data

For a total uninstallation of nomination, a data removal is necessary. To do so, first of all, you need to search for the right persistence volume. To identify it, you need to type de command below, and search for a volume containing the helm release name.

kubectl get pvc

You'll receive an output similar to:

NAMESTATUSVOLUMECAPACITYACCESS MODESSTORAGECLASSAGE
data-nominatim-postgresql-0Boundpvc-b450c62d-d888-4869-9568-298e6d10b597500GiRWOstandard3d1h

Once you found the correct PVC, you just need to type de command to delete it:

kubectl delete pvc data-nominatim-postgresql-0

Or, you may use a single command for both operation, like following:

kubectl delete pvc -l app.kubernetes.io/instance=nominatim

Note: The command above may differ a little depending the k8s cluster version you're using.

Parameters

Global parameters

NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.storageClassGlobal StorageClass for Persistent Volume(s)""

Common parameters

NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override common.names.fullname template (will maintain the release name)""
fullnameOverrideString to fully override common.names.fullname template""
commonLabelsLabels to add to all deployed resources{}
commonAnnotationsAnnotations to add to all deployed resources{}
clusterDomainKubernetes Cluster Domaincluster.local
extraDeployArray of extra objects to deploy with the release[]
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the deployment["sleep"]
diagnosticMode.argsArgs to override all containers in the deployment

Nominatim Image parameters

NameDescriptionValue
image.registryNominatim image registrydocker.io
image.repositoryNominatim image repositorymediagis/nominatim
image.tagNominatim image tag (immutable tags are recommended)4.4
image.digestNominatim image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag""
image.pullPolicyNominatim image pull policyIfNotPresent
image.pullSecretsNominatim image pull secrets[]
image.debugSpecify if debug values should be set

Nominatim Initialisation Configuration parameters

NameDescriptionValue
initJob.enabledenable/disable init jobfalse
initJob.pbfUrlURL of the pbf file to importhttps://download.geofabrik.de/europe/germany/sachsen-latest.osm.pbf
initJob.importWikipediaIf additional Wikipedia/Wikidata rankings should be importefalse
initJob.wikipediaUrlWikipedia/Wikidata rankings file URLhttps://nominatim.org/data/wikimedia-importance.sql.gz
initJob.importGB_PostcodeIf external GB postcodes should be importedfalse
initJob.importUS_PostcodeIf external US postcodes should be importedfalse
initJob.importStyleNominatim import stylefull
initJob.customStyleUrlCustom import style file URLnil
initJob.threadsThe number of thread used by the import16
initJob.dbWaitTimeoutThe number of seconds to wait for the DB to be ready to accept connections300
initJob.extraEnvVarsArray with extra environment variables to add to the container[]
initJob.extraVolumeMountsOptionally specify extra list of additional volumeMounts for container(s)[]
initJob.extraVolumesOptionally specify extra list of additional volumes for initJob pods[]

Nominatim Initialisation Deployment parameters

NameDescriptionValue
initJob.resourcesDefine resources requests and limits for the init container{}
initJob.persistence.enabledEnable persistence using Persistent Volume Claimsfalse
initJob.persistence.storageClassPersistent Volume storage classnil
initJob.persistence.accessModesPersistent Volume access modes[ReadWriteOnce]
initJob.persistence.sizePersistent Volume size100Gi
initJob.persistence.dataSourceCustom PVC data source{}
initJob.persistence.existingClaimThe name of an existing PVC to use for flatnodenil
initJob.persistence.selector

Deploy nominatim with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nominatim 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 chartnominatim is pinned at v6.5.1 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