Skip to content

Commit

Permalink
chore:rsync based file transfer (#879)
Browse files Browse the repository at this point in the history
* tmp

* fixed pathing issues

* made sure that the k3s resources are also configured

* made sure that the k3s resources are also configured
  • Loading branch information
CommanderStorm authored Nov 12, 2023
1 parent a73961e commit 4ced11b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 8 deletions.
13 changes: 13 additions & 0 deletions deployment/k3s/files/rsyncd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use chroot = true

transfer logging = true
log file = /dev/stdout
log format = %h %o %f %l %b

[maps]
comment = Public Share
path = /home/maps
read only = yes
list = yes
uid = nobody
gid = nogroup
15 changes: 11 additions & 4 deletions deployment/k3s/templates/deployments/maps/maps-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,19 @@ spec:
failureThreshold: 6
periodSeconds: 10
- name: tileserver-src # serve tileserver-vol at /maps/vol/...
image: nginx:1.25
image: alpine:18
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- "apk add --no-cache rsync && rsync --daemon --no-detach --config=/etc/rsyncd.conf"
ports:
- containerPort: 80
name: http
- containerPort: 873
name: rsync
volumeMounts:
- name: tileserver-vol
mountPath: /usr/share/nginx/html/maps/vol
mountPath: /home/maps/vol
readOnly: true
- name: tileserver-config
mountPath: /etc/rsyncd.conf
subPath: rsyncd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
data:
osm-liberty.json: |-
{{ .Files.Get "files/maps/osm-liberty.json" | indent 4 }}
rsyncd.conf: |-
{{ .Files.Get "files/maps/rsyncd.conf" | indent 4 }}
config.json: |-
{
"options": {
Expand Down
2 changes: 1 addition & 1 deletion deployment/k3s/templates/networking/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
match: Host(`{{ $.Values.url }}`) && PathPrefix(`/maps/vol/`)
services:
- name: maps-svc
port: 7771
port: 873
- kind: Rule
match: Host(`{{ $.Values.url }}`) && PathPrefix(`/maps/`)
services:
Expand Down
4 changes: 2 additions & 2 deletions deployment/k3s/templates/networking/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ spec:
port: 3001
targetPort: 8080
- name: src
port: 7771
targetPort: 80
port: 873
targetPort: 873
---
apiVersion: v1
kind: Service
Expand Down
11 changes: 10 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
tileserver-init-src:
image: alpine:latest
restart: on-failure
command: wget -P /map --continue https://nav.tum.de/maps/vol/output.mbtiles
command: rsync --update --compress --progress --partial --human-readable --stats rsync://nav.tum.de/maps/vol/output.mbtiles /map/output.mbtiles
volumes:
- ./map:/map
tileserver:
Expand All @@ -58,6 +58,15 @@ services:
condition: service_completed_successfully
tileserver-init-src:
condition: service_completed_successfully
tileserver-rsync-deamon-src:
image: alpine:3.18
restart: always
command: sh -c "apk add --no-cache rsync && rsync --daemon --no-detach --config=/etc/rsyncd.conf"
volumes:
- ./deployment/k3s/files/rsyncd.conf:/etc/rsyncd.conf:ro
- ./map/output.mbtiles:/home/maps/vol/output.mbtiles:ro
ports:
- "873:873"
# cdn
data:
image: ghcr.io/tum-dev/navigatum-cdn:latest
Expand Down

0 comments on commit 4ced11b

Please sign in to comment.