apiVersion: v1
kind: List
items:
- apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: cmoa-collector
    namespace: imxc
    labels:
      app: cmoa-collector
  spec:
    replicas: 1
    selector:
      matchLabels:
        app: cmoa-collector
    template:
      metadata:
        labels:
          app: cmoa-collector
      spec:
        securityContext:
          runAsNonRoot: true
          runAsUser: 65534
        containers:
        - name: cmoa-collector
          image: {{ .Values.global.IMXC_IN_REGISTRY }}/cmoa-collector:{{ .Values.global.COLLECTOR_VERSION }}
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: 100m
              memory: 500Mi
            limits:
              cpu: 500m
              memory: 2500Mi
          ports:
          - containerPort: 12010
          env:
            - name: LOCATION
              value: Asia/Seoul
            - name: KAFKA_SERVER
              value: kafka:9092
            - name: ELASTICSEARCH
              value: elasticsearch:9200
#            - name: PROMETHEUS
#              value: nginx-cortex/prometheus
            - name: REDIS_ADDR
              value: redis-master:6379
            - name: REDIS_PW
              value: dkagh1234!
            - name: REDIS_DB
              value: "0"
            - name: REDIS_TYPE
              value: normal
            - name: CMOA_ES_ID
              value: {{ .Values.global.CMOA_ES_ID }}
            - name: CMOA_ES_PW
              value: {{ .Values.global.CMOA_ES_PW }}              
          resources:
            requests:
              cpu: "300m"
              memory: "1500Mi"
            limits:
              cpu: "500m"
              memory: "2500Mi"
- apiVersion: v1
  kind: Service
  metadata:
    name: cmoa-collector
    namespace: imxc
    labels:
      app: cmoa-collector
  spec:
    ports:
    - name: cmoa-collector-exporter
      port: 12010
      targetPort: 12010
    selector:
      app: cmoa-collector

