apiVersion: apps/v1
kind: Deployment
metadata:
  name: indexer-agent
spec:
  selector:
    matchLabels:
      app: indexer-agent
  replicas: 1
  template:
    metadata:
      labels:
        app: indexer-agent
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/path: "/metrics"
        prometheus.io/port: "7300"
    spec:
      containers:
        - name: indexer-agent
          image: indexer-agent-image
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 600m
          ports:
            - name: http
              containerPort: 7600
            - name: metrics
              containerPort: 7300
            - name: management
              containerPort: 8000
          env:
            - name: INDEXER_AGENT_MNEMONIC
              valueFrom:
                secretKeyRef:
                  name: indexer-mnemonic
                  key: mnemonic
            - name: INDEXER_AGENT_INDEX_NODE_IDS
              value: index-node-0
            - name: INDEXER_AGENT_GRAPH_NODE_QUERY_ENDPOINT
              value: http://query-node.default.svc.cluster.local/
            - name: INDEXER_AGENT_GRAPH_NODE_ADMIN_ENDPOINT
              value: http://index-node.default.svc.cluster.local/
            - name: INDEXER_AGENT_GRAPH_NODE_STATUS_ENDPOINT
              value: http://query-node.default.svc.cluster.local/index-node/graphql
            - name: INDEXER_AGENT_POSTGRES_HOST
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: host
            - name: INDEXER_AGENT_POSTGRES_USERNAME
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: user
            - name: INDEXER_AGENT_POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: password
            - name: INDEXER_AGENT_POSTGRES_DATABASE
              value: indexer-service
