apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: logtail
  namespace: akkeris-system
spec:
  selector:
    matchLabels:
      name: logtail
  serviceName: "logtail"
  replicas: 2
  template:
    metadata:
      labels:
        name: logtail
      annotations:
        prometheus.io/port: "9000"
        prometheus.io/scrape: "true"
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: logtail
        image: akkeris/logtrain:v0.1.1
        command:
          - ./logtail
        env:
        - name: NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: KUBERNETES_DATASOURCE
          value: "true"
        - name: SYSLOG_TCP
          value: "true"
        - name: PROFILE
          value: "true"
        - name: AKKERIS
          value: "true"
        - name: DEBUG
          value: "true"
        ports:
        - containerPort: 9000
          protocol: TCP
        - containerPort: 9002
          protocol: TCP
        resources:
          limits:
            memory: 128Mi
          requests:
            memory: 64Mi
      securityContext: {}
      serviceAccount: logtrain
      serviceAccountName: logtrain
