File tree 5 files changed +34
-2
lines changed
5 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -52,4 +52,6 @@ COPY ./start.sh .
52
52
COPY ./expire-watcher.sh .
53
53
COPY ./seed-by-diffs.sh .
54
54
COPY ./tile_cache_downloader.sh .
55
- CMD ./start.sh & ./tile_cache_downloader.sh & ./expire-watcher.sh
55
+ COPY ./rm_tegola_ps.sh .
56
+
57
+ CMD ./start.sh & ./tile_cache_downloader.sh & ./expire-watcher.sh & ./rm_tegola_ps.sh
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ flag=true
3
3
while " $flag " = true ; do
4
4
pg_isready -h $POSTGRES_HOST -p 5432 > /dev/null 2>&2 || continue
5
5
flag=false
6
- ./tile_cache_downloader.sh & ./expire-watcher.sh
6
+ ./tile_cache_downloader.sh & ./expire-watcher.sh & ./rm_tegola_ps.sh
7
7
done
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+ if [[ -n " ${KILL_PROCESS} " && " ${KILL_PROCESS} " == " manually" ]]; then
4
+ while true ; do
5
+ NUM_PS=$( ps | grep ${PROCESS_NAME} | grep -v grep | wc -l)
6
+ if [[ $NUM_PS -gt $MAX_NUM_PS ]]; then
7
+ aws s3 rm s3://${TILER_CACHE_BUCKET} /mnt/data/osm/ --recursive
8
+ echo " ${PROCESS_NAME} processes"
9
+ ps aux | grep ${PROCESS_NAME} | grep -v grep
10
+ # After clearing the S3 cache, terminate all 'tegola' processes.
11
+ killall ${PROCESS_NAME}
12
+ fi
13
+ sleep 600
14
+ done
15
+ fi
Original file line number Diff line number Diff line change 62
62
value : {{ quote .Values.tilerServer.env.TILER_CACHE_AWS_SECRET_ACCESS_KEY }}
63
63
- name : TILER_CACHE_MAX_ZOOM
64
64
value : {{ quote .Values.tilerServer.env.TILER_CACHE_MAX_ZOOM }}
65
+ - name : MAX_NUM_PS
66
+ value : {{ quote .Values.tilerServerCacheCleaner.env.MAX_NUM_PS }}
67
+ - name : PROCESS_NAME
68
+ value : {{ .Values.tilerServerCacheCleaner.env.PROCESS_NAME }}
69
+ - name : KILL_PROCESS
70
+ value : {{ .Values.tilerServerCacheCleaner.env.KILL_PROCESS }}
65
71
- name : CLOUDPROVIDER
66
72
value : {{ .Values.cloudProvider }}
67
73
# In case cloudProvider=aws
Original file line number Diff line number Diff line change @@ -443,10 +443,19 @@ tilerServerCacheCleaner:
443
443
limits :
444
444
memory : ' 2Gi'
445
445
cpu : ' 2'
446
+ env :
447
+ KILL_PROCESS : manually
448
+ MAX_NUM_PS : 3
449
+ PROCESS_NAME : tegola
446
450
nodeSelector :
447
451
enabled : false
448
452
label_key : nodegroup_type
449
453
label_value : tiler
454
+ autoscaling :
455
+ enabled : false
456
+ minReplicas : 1
457
+ maxReplicas : 2
458
+ cpuUtilization : 60
450
459
# ====================================================================================================
451
460
# Variables for tiler-visor
452
461
# ====================================================================================================
You can’t perform that action at this time.
0 commit comments