---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gnis
  labels:
    app: gnis

spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app: gnis
  template:
    metadata:
      labels:
        app: gnis
    spec:
      containers:
      - name: graphdb
        image: gnislinkeddata/graphdb
        ports:
        - containerPort: 7200
        volumeMounts:
        - mountPath: /root
          name: gnis-volume
        readinessProbe:
          initialDelaySeconds: 5400
          periodSeconds: 10
          timeoutSeconds: 1800
          successThreshold: 1
          failureThreshold: 3
          tcpSocket:
            port: 7200

      - name: triplifier
        image: gnislinkeddata/triplifier
        imagePullPolicy: "Always"
        command: ["npm","run"]
        args: ["update"]
        env:
        - name: PGUSER
          value: "docker"
        - name: PGPASSWORD
          value: "docker"
        - name: PGHOST
          value: "localhost"
        - name: PGPORT
          value: "5432"
        - name: PGDATABASE
          value: "gis"
        - name: USGS_DATA_HOST
          value: "stage.gnis-ld.org"
        - name: S_DATA_HOST
          value: "/"
        - name: GDBHOST
          value: "http://localhost"
        - name: GDBPASSWORD
          value: "GDBPASSWORD"
        ports:
        - containerPort: 8890
        volumeMounts:
        - mountPath: /root
          name: gnis-volume

      - name: gnis-ld
        image: gnislinkeddata/gnis-ld:dev
        imagePullPolicy: "Always"
        env:
        - name: PGUSER
          value: "script"
        - name: PGPASSWORD
          value: "pass"
        - name: PGHOST
          value: "http://localhost"
        - name: PGPORT
          value: "5432"
        - name: PGDATABASE
          value: "gis"
        - name: BASE
          value: "stage.gnis-ld.org"
        - name: USGS_DATA_PATH
          value: "/"
        - name: "USGS_ENDPOINT_URL"
          value: "http://localhost:7200"
        ports:
        - containerPort: 80
        
      - name: postgis
        image: kartoza/postgis:10.0-2.4
        readinessProbe:
          initialDelaySeconds: 5400
          periodSeconds: 10
          timeoutSeconds: 1800
          successThreshold: 1
          failureThreshold: 3
          tcpSocket:
            port: 5432
        ports:
        - containerPort: 5432
      volumes:
        - name: gnis-volume
          persistentVolumeClaim:
            claimName: cephfs-gnis-pvc
