apiVersion: batch/v1
kind: Job
metadata:
  namespace: k8s-elk-lite
  name: metricbeat-template-init
spec:
  template:
    spec:
      containers:
      - name: metricbeat-template-init
        image: docker.elastic.co/beats/metricbeat:6.5.4
        command: [ "metricbeat", "setup", "--template",
          "-E", "output.logstash.enabled=false",
          "-E", 'output.elasticsearch.hosts=["elasticsearch.k8s-elk-lite.svc.cluster.local:9200"]' ]
      restartPolicy: Never
  backoffLimit: 4
