apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: default
  labels:
    service: bchd
    version: 0.15.0
  name: bchd
spec:
  strategy:
    type: Recreate
  replicas: 1
  selector:
    matchLabels:
      service: bchd
  template:
    metadata:
      labels:
        service: bchd
    spec:
      containers:
      - env:
        - name: BCHD_RPC_USER
          valueFrom:
            secretKeyRef:
              name: bchd
              key: rpcuser
        - name: BCHD_RPC_PASSWORD
          valueFrom:
            secretKeyRef:
              name: bchd
              key: rpcpass
        image: zquestz/bchd:latest
        command: ["bchd"]
        args: ["-u", "$(BCHD_RPC_USER)", "-P", "$(BCHD_RPC_PASSWORD)", "--addrindex", "--txindex", "-b", "/data", "-C", "/data/bchd.conf"]
        name: bchd
        volumeMounts:
          - mountPath: /data
            name: bchd-data
        resources:
          requests:
            memory: "3Gi"
      restartPolicy: Always
      terminationGracePeriodSeconds: 600
      volumes:
        - name: bchd-data
          gcePersistentDisk:
            pdName: bchd-data
            fsType: ext4
