initial working but bare setup
This commit is contained in:
67
base/importer.cronjob.yaml
Normal file
67
base/importer.cronjob.yaml
Normal file
@@ -0,0 +1,67 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: importer
|
||||
spec:
|
||||
schedule: '0 0 1 1 1'
|
||||
concurrencyPolicy: Forbid
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: download
|
||||
image: download
|
||||
command: ["/bin/sh", "-c"]
|
||||
args:
|
||||
- '[ ! -f /data/latest.osm.pbf ] && curl -o /data/latest.osm.pbf http://download.geofabrik.de/europe/switzerland-251123.osm.pbf || echo "File already exists, skipping download"'
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
|
||||
|
||||
|
||||
- name: importer
|
||||
image: importer
|
||||
args:
|
||||
- --create
|
||||
- --input-reader=pbf
|
||||
- --output=flex
|
||||
- --style=/rules/anyway.lua
|
||||
- /data/latest.osm.pbf
|
||||
|
||||
# connection details are implictly loaded from env vars, not set as args
|
||||
|
||||
# Environment Variables
|
||||
env:
|
||||
- name: PGHOST
|
||||
value: "osm-postgresql-r"
|
||||
- name: PGPORT
|
||||
value: "5432"
|
||||
- name: PGDATABASE
|
||||
value: "osm"
|
||||
- name: PGUSER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: osm-postgresql-app
|
||||
key: username
|
||||
- name: PGPASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: osm-postgresql-app
|
||||
key: password
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: rules
|
||||
mountPath: /rules
|
||||
|
||||
restartPolicy: Never
|
||||
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: worldfile
|
||||
- name: rules
|
||||
configMap:
|
||||
name: importer-config
|
||||
Reference in New Issue
Block a user