apiVersion: apps/v1
kind: Deployment
metadata:
  name: aquarius-rpc
spec:
  selector:
    matchLabels:
      app: aquarius-rpc
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
  template:
    metadata:
      labels:
        app: aquarius-rpc
    spec:
      serviceAccountName: aquarius-rpc
      volumes:
        - name: aquarius-rpc-secrets-store-inline
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: aquarius-rpc-aws-secrets
      containers:
      - name: aquarius-rpc
        image: aquarius-rpc-image
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: 5000
            scheme: HTTP
          initialDelaySeconds: 20
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 2
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: 5000
            scheme: HTTP
          initialDelaySeconds: 20
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        ports:
          - containerPort: 5000
        env:
          - name: DB_HOSTNAME
            valueFrom:
              secretKeyRef:
                name: aquarius-rpc
                key: DB_HOSTNAME
          - name: DB_PORT
            valueFrom:
              secretKeyRef:
                name: aquarius-rpc
                key: DB_PORT
          - name: DB_USERNAME
            valueFrom:
              secretKeyRef:
                name: aquarius-rpc
                key: DB_USERNAME
          - name: DB_PASSWORD
            valueFrom:
              secretKeyRef:
                name: aquarius-rpc
                key: DB_PASSWORD
          - name: DB_SSL
            value: 'true'
          - name: DB_VERIFY_CERTS
            value: 'true'
          - name: METADATA_CONTRACT_BLOCK
            value: '12341835'
          - name: BFACTORY_BLOCK
            value: '12341835'
          - name: LOG_LEVEL
            value: DEBUG
          - name: RUN_AQUARIUS_SERVER
            value: '1'
          - name: RUN_EVENTS_MONITOR
            value: '0'
          - name: EVENTS_ALLOW
            value: '0'
        volumeMounts:
          - name: aquarius-rpc-secrets-store-inline
            mountPath: /mnt/secrets
            readOnly: true
