From eb34cedbf0558f35bfef55c79b1deaf443fa4da7 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Sat, 19 Jul 2025 21:57:40 +0200 Subject: [PATCH] added better cpu load, probes --- base/configmap.yaml | 22 +++++++++++----------- base/deployment.yaml | 33 +++++++++++++++++++++++++++++++-- overlays/stg/configmap.yaml | 9 +++++++-- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/base/configmap.yaml b/base/configmap.yaml index 6d88a80..d821e20 100644 --- a/base/configmap.yaml +++ b/base/configmap.yaml @@ -10,36 +10,36 @@ data: # attic, yes, or no. Passed as --keep-attic, --meta, or nothing to update_database and init. Defaults to no. OVERPASS_META: "no" - + # (init mode only) url to a "planet" file (e.g. https://planet.openstreetmap.org/planet/planet-latest.osm.bz2) OVERPASS_PLANET_URL: "https://planet.openstreetmap.org/planet/planet-latest.osm.bz2" - + # (clone mode only) the url to clone a copy of Overpass from. Defaults to https://dev.overpass-api.de/api_drolbr/, which uses minute diffs. # OVERPASS_CLONE_SOURCE: "" - + # url to a diff directory for updating the instance (e.g. https://planet.openstreetmap.org/replication/minute/). # intentionally use the lower resolution OVERPASS_DIFF_URL: "https://planet.openstreetmap.org/replication/day/" - + # (init mode only) takes values of no, gz or lz4. Specifies compression mode of the Overpass database. Defaults to gz. # keep the default here # OVERPASS_COMPRESSION: "" - + # integer, desired load from area generation. Controls the ratio of sleep to work. A value of 1 will make the system sleep 99x times longer than it works, a value of 50 will result in sleep and work in equal measure, and a value of 100 will only sleep 3 seconds between each execution. Defaults to 1. - OVERPASS_RULES_LOAD: "" - + OVERPASS_RULES_LOAD: "50" + # integer, the delay between updates (seconds). OVERPASS_UPDATE_SLEEP: "" - + # cookie-jar compatible content to be used when fetching planet.osm files and updates. # OVERPASS_COOKIE_JAR_CONTENTS: "" - + # commands to be run before passing the planet.osm file to update_database, e.g. conversion from pbf to osm.bz2 using osmium. # OVERPASS_PLANET_PREPROCESS: "" - + # commands to be run before passing the diff.osc file to update_database, e.g. extracting geo specific regions # OVERPASS_DIFF_PREPROCESS: "" - + # set to yes if you want to use oauth_cookie_client to update cookies before each update. Settings are read from /secrets/oauth-settings.json. Read the documentation here. # USE_OAUTH_COOKIE_CLIENT: "" diff --git a/base/deployment.yaml b/base/deployment.yaml index 0f9e4e5..d3411ef 100644 --- a/base/deployment.yaml +++ b/base/deployment.yaml @@ -28,12 +28,41 @@ spec: ports: - containerPort: 12345 - # readinessProbe: TODO + startupProbe: + # Gives the container 180m = 3h to start up + httpGet: + path: /api/interpreter + port: 12345 + periodSeconds: 60 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 180 + + # readinessProbe: + # # Mark the conainer as unready when requests are not being served + # httpGet: + # path: /api/interpreter + # port: 12345 + # initialDelaySeconds: 3600 + # periodSeconds: 60 + # timeoutSeconds: 5 + # successThreshold: 1 + + livenessProbe: + # Mark the container as unhealthy when requests are not being served + httpGet: + path: /api/interpreter + port: 12345 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 2 + + # livenessProbe: TODO volumeMounts: - name: overpass-data - mountPath: /database + mountPath: /db volumes: - name: overpass-data persistentVolumeClaim: diff --git a/overlays/stg/configmap.yaml b/overlays/stg/configmap.yaml index 6319162..4d78545 100644 --- a/overlays/stg/configmap.yaml +++ b/overlays/stg/configmap.yaml @@ -3,5 +3,10 @@ kind: ConfigMap metadata: name: overpass-config data: - # only monaco - OVERPASS_PLANET_URL: "https://planet.openstreetmap.org/TODO" + # # only a small subset of the world in this case + # OVERPASS_PLANET_URL: "https://download.geofabrik.de/europe/italy-latest.osm.pbf" + + OVERPASS_PLANET_URL: "http://download.geofabrik.de/europe/belgium-latest.osm.bz2" + + # left empty because we don't want to diff the whole world + OVERPASS_DIFF_URL: ""