apiVersion: apps/v1
kind: Deployment
metadata:
  name: pippin-nano
  namespace: pippin
spec:
  replicas: 2
  selector:
    matchLabels:
      app: pippin-nano
  template:
    metadata:
      labels:
        app: pippin-nano
    spec:
      containers:
      - name: pippin-nano
        image: bananocoin/pippin:1.1.25
        resources:
          requests:
            cpu: 500m
            memory: 500Mi
          limits:
            cpu: 1500m
            memory: 4000Mi
        ports:
        - containerPort: 11338
          name: api
        env:
          - name: REDIS_HOST
            value: redis-0.redis
          - name: REDIS_DB
            value: "1"
          - name: POSTGRES_HOST
            value: postgres.postgres
          - name: POSTGRES_DB
            valueFrom:
              secretKeyRef:
                name: nano
                key: postgres_db
          - name: POSTGRES_USER
            valueFrom:
              secretKeyRef:
                name: nano
                key: postgres_user
          - name: POSTGRES_PASSWORD
            valueFrom:
              secretKeyRef:
                name: nano
                key: postgres_password
          - name: BPOW_USER
            valueFrom:
              secretKeyRef:
                name: nano
                key: bpow_user
          - name: BPOW_KEY
            valueFrom:
              secretKeyRef:
                name: nano
                key: bpow_key
        volumeMounts:
        - name: conf
          mountPath: /root/PippinData
          readOnly: true
      volumes:
      - name: conf
        configMap:
          name: pippin-nano
          defaultMode: 0755
