apiVersion: apps/v1
kind: Deployment
metadata:
  name: datamon-ro-demo
  namespace: datamon-ci
spec:
  selector:
    matchLabels:
      app: datamon-ro-demo
  replicas: 1
  template:
    metadata:
      labels:
        app: datamon-ro-demo
    spec:
      containers:
      - name: demo-shell
        image: gcr.io/onec-co/datamon-fuse-demo-shell:latest
        imagePullPolicy: "Always"
        command: ["/bin/tini"]
        args: ["--", "/bin/zsh"]
        stdin: true
        tty: true
        volumeMounts:
        - mountPath: /tmp/mount
          name: fuse-mountpoint
          mountPropagation: "HostToContainer"
      - name: datamon-sidecar
        image: gcr.io/onec-co/datamon-fuse-demo-sidecar:latest
        imagePullPolicy: "Always"
        command: ["datamon"]
        args: ["bundle", "mount",
        "--repo", "$REPO_NAME",
        "--bundle", "$BUNDLE_ID",
        "--mount", "/tmp/mount",
        "--stream"]
        securityContext:
          privileged: true
        stdin: true
        tty: true
        volumeMounts:
        - mountPath: /tmp/mount
          name: fuse-mountpoint
          mountPropagation: "Bidirectional"
        - mountPath: /tmp/gac
          name: google-application-credentials
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /tmp/gac/google-application-credentials.json
        resources:
          requests:
            memory: "27G"
      volumes:
      - name: fuse-mountpoint
        emptyDir: {}
      - name: google-application-credentials
        secret:
          secretName: google-application-credentials

      tolerations:
      - key: "oneconcern.com/flood"
        operator: Equal
        value: "inundation"
      nodeSelector:
        kubernetes.io/role: "flood-pipeline"

      # tolerations:
      #   - key: "oneconcern.com/dedicated"
      #     operator: Equal
      #     value: "geodude"
      # nodeSelector:
      #     kubernetes.io/role: "geodude"

