apiVersion: apps/v1
kind: Deployment
metadata:
  name: osrm-$VERSION-deployment
  labels:
    app: osrm
    version: "$VERSION"
spec:
  replicas: 2
  selector:
    matchLabels:
      app: osrm
      version: "$VERSION"
  template:
    metadata:
      labels:
        app: osrm
        version: "$VERSION"
    spec:
      containers:
      - name: tileserver-$VERSION
        image: osrm/osrm-backend
        command: ["/bin/sh","-c"]
        args: ["cp -a /nfs-share/. /data; osrm-routed --algorithm mld /data/netherlands-latest.osrm"]
        ports:
        - containerPort: 5000
        volumeMounts:
        - name: osrm-$VERSION-volume
          mountPath: /nfs-share
          subPath: osrm
      volumes:
      - name: osrm-$VERSION-volume
        persistentVolumeClaim:
          claimName: nfs
