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