apiVersion: apps/v1
kind: Deployment
metadata:
  name: opni-metrics-service
  namespace: opni-monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      app: opni-metrics-service
  template:
    metadata:
      labels:
        app: opni-metrics-service
    spec:
      containers:
      - name: opni-metrics-service
        image: tybalex/opni-metrics-service:dev
        imagePullPolicy: Always
        env:
        - name: PROMETHEUS_ENDPOINT
          value: "https://cortex-query-frontend:8080/"
        - name: ES_ENDPOINT
          value: "https://ot-os-os-client.default.svc:9200/"
        - name: ES_USERNAME
          value: "admin"
        - name: ES_PASSWORD
          value: "admin"
        - name: NATS_SERVER_URL
          value: nats://cluster-nats-client.opni.svc:4222
        - name: NKEY_SEED_FILENAME
          value: /etc/nkey/seed
        volumeMounts:
            - name: cortex-client-certs
              mountPath: /run/cortex/certs/client
            - name: cortex-server-cacert
              mountPath: /run/cortex/certs/server
      volumes:
        - name: cortex-client-certs
          secret:
            secretName: cortex-client-cert-keys
            defaultMode: 256
            items:
              - key: tls.crt
                path: tls.crt
              - key: tls.key
                path: tls.key
              - key: ca.crt
                path: ca.crt
        - name: cortex-server-cacert
          secret:
            secretName: cortex-serving-cert-keys
            defaultMode: 256
            items:
              - key: ca.crt
                path: ca.crt
