---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: zagent-deployment
spec:
  selector:
    matchLabels:
      app: zagent
  replicas: 1 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: zagent
    spec:
      containers:
      - name: zagent
        image: doubtingben/zagent
        args: ["--"]
        env:
        - name: RPC_HOST
          value: zcashd.default.svc.cluster.local
        - name: RPC_PORT
          valueFrom:
            configMapKeyRef:
              name: zcash-insight-env
              key: ZCASHD_RPCPORT
        - name: RPC_USER
          valueFrom:
            configMapKeyRef:
              name: zcash-insight-env
              key: ZCASHD_RPCUSER
        - name: RPC_PASSWORD
          valueFrom:
            secretKeyRef:
              name: zcashd-rpc
              key: password
        - name: BIND_ADDR
          value: 0.0.0.0:3000           
        ports:
          - containerPort: 3000
        