apiVersion: batch/v1
kind: Job
metadata:
  name: stf-smoketest-<<CLOUDNAME>>
spec:
  parallelism: 1
  completions: 1
spec:
  template:
    metadata:
      labels:
        app: stf-smoketest
    spec:
      restartPolicy: Never
      containers:
      - name: smoketest-collectd
        image: quay.io/tripleomaster/openstack-collectd:current-tripleo
        command:
        - /smoketest_collectd_entrypoint.sh
        env:
        - name: CLOUDNAME
          value: <<CLOUDNAME>>
        - name: ELASTICSEARCH_AUTH_PASS
          value: <<ELASTICSEARCH_AUTH_PASS>>
        - name: PROMETHEUS_AUTH_PASS
          value: <<PROMETHEUS_AUTH_PASS>>
        volumeMounts:
        - name: collectd-config
          mountPath: /etc/minimal-collectd.conf.template
          subPath: minimal-collectd.conf.template
        - name: sensubility-config
          mountPath: /etc/collectd-sensubility.conf
          subPath: collectd-sensubility.conf
        - name: healthcheck-log
          mountPath: /healthcheck.log
          subPath: healthcheck.log
        - name: collectd-entrypoint-script
          mountPath: /smoketest_collectd_entrypoint.sh
          subPath: smoketest_collectd_entrypoint.sh
        securityContext:
          allowPrivilegeEscalation: false

      - name: smoketest-ceilometer
        image: quay.io/tripleomaster/openstack-ceilometer-notification:current-tripleo
        command:
        - /smoketest_ceilometer_entrypoint.sh
        env:
        - name: CLOUDNAME
          value: <<CLOUDNAME>>
        - name: ELASTICSEARCH_AUTH_PASS
          value: <<ELASTICSEARCH_AUTH_PASS>>
        - name: PROMETHEUS_AUTH_PASS
          value: <<PROMETHEUS_AUTH_PASS>>
        volumeMounts:
        - name: ceilometer-publisher
          mountPath: /ceilometer_publish.py
          subPath: ceilometer_publish.py
        - name: ceilometer-entrypoint-script
          mountPath: /smoketest_ceilometer_entrypoint.sh
          subPath: smoketest_ceilometer_entrypoint.sh
      volumes:
      - name: collectd-config
        configMap:
          name: stf-smoketest-collectd-config
      - name: sensubility-config
        configMap:
          name: stf-smoketest-sensubility-config
      - name: healthcheck-log
        configMap:
          name: stf-smoketest-healthcheck-log
      - name: collectd-entrypoint-script
        configMap:
          name: stf-smoketest-collectd-entrypoint-script
          defaultMode: 0555
      - name: ceilometer-entrypoint-script
        configMap:
          name: stf-smoketest-ceilometer-entrypoint-script
          defaultMode: 0555
      - name: ceilometer-publisher
        configMap:
          name: stf-smoketest-ceilometer-publisher
          defaultMode: 0555
