apiVersion: apps/v1
kind: Deployment
metadata:
  name: indexer
  namespace: explorer
spec:
  replicas: 2
  selector:
    matchLabels:
      app: indexer
  template:
    metadata:
      labels:
        app: indexer
    spec:
      containers:
      - name: indexer
        image: explorer/indexer:latest
        env:
        - name: DB_HOST
          valueFrom:
            secretKeyRef:
              name: db-credentials
              key: host
        - name: DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: db-credentials
              key: password
        - name: RPC_URL
          valueFrom:
            configMapKeyRef:
              name: indexer-config
              key: rpc_url
        resources:
          requests:
            memory: "512Mi"
            cpu: "250m"
          limits:
            memory: "2Gi"
            cpu: "1000m"
---
apiVersion: v1
kind: Service
metadata:
  name: indexer
  namespace: explorer
spec:
  selector:
    app: indexer
  ports:
  - port: 8080
    targetPort: 8080

