apiVersion: apps/v1
kind: Deployment
metadata:
  name: preprocessing-service
  namespace: opni-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: preprocessing-service
  template:
    metadata:
      labels:
        app: preprocessing-service
    spec:
      initContainers:
      - name: kibana-dashboard
        image: rancher/opni-kibana-dashboard:v0.1.1
        imagePullPolicy: Always
        env:
        - name: ES_ENDPOINT
          value: "https://opendistro-es-client-service.opni-system.svc.cluster.local:9200"
        - name: ES_USER
          value: "%ES_USER%"
        - name: ES_PASSWORD
          value: "%ES_PASSWORD%"
      containers:
      - name: preprocessing-service
        image: rancher/opni-preprocessing-service:v0.1.1
        imagePullPolicy: Always
        env:
        - name: NATS_SERVER_URL
          value: "nats://nats_client:%NATS_PASSWORD%@nats-client.opni-system.svc:4222"
        - name: ES_ENDPOINT
          value: "https://opendistro-es-client-service.opni-system.svc.cluster.local:9200"
        - name: ES_USERNAME
          value: "%ES_USER%"
        - name: ES_PASSWORD
          value: "%ES_PASSWORD%"
