Browse Source

Added tempest-pushgateway

Change-Id: Iea0659f8290044948492dc25dd92b3566af62727
changes/14/746414/1
Mohammed Naser 2 years ago
parent
commit
d28405f4b9
  1. 11
      charts/tempest-pushgateway/Chart.yaml
  2. 41
      charts/tempest-pushgateway/templates/_helpers.tpl
  3. 33
      charts/tempest-pushgateway/templates/cronjob.yaml
  4. 57
      charts/tempest-pushgateway/templates/prometheusrule.yaml
  5. 10
      charts/tempest-pushgateway/templates/secret.yaml
  6. 15
      charts/tempest-pushgateway/values.yaml

11
charts/tempest-pushgateway/Chart.yaml

@ -0,0 +1,11 @@
---
apiVersion: v1
name: tempest-pushgateway
version: 0.0.0
description: Tempest cron job pushing data to Prometheus Pushgateway
home: https://github.com/vexxhost/helm-charts
maintainers:
- name: Mohammed Naser
email: mnaser@vexxhost.com
url: https://github.com/mnaser
appVersion: v1.0.0

41
charts/tempest-pushgateway/templates/_helpers.tpl

@ -0,0 +1,41 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "tempest-pushgateway.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "tempest-pushgateway.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Generate basic labels
*/}}
{{- define "tempest-pushgateway.labels" }}
app.kubernetes.io/name: {{ include "tempest-pushgateway.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: metrics
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "tempest-pushgateway.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

33
charts/tempest-pushgateway/templates/cronjob.yaml

@ -0,0 +1,33 @@
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
namespace: {{ .Release.Namespace }}
name: {{ include "tempest-pushgateway.fullname" . }}
labels:
{{- include "tempest-pushgateway.labels" . | indent 4 }}
spec:
schedule: "*/5 * * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
backoffLimit: 0
template:
metadata:
labels:
{{- include "tempest-pushgateway.labels" . | indent 12 }}
spec:
restartPolicy: Never
containers:
- name: tempest-pushgateway
image: {{ .Values.image }}
envFrom:
- secretRef:
name: {{ include "tempest-pushgateway.fullname" . }}
args:
{{ toYaml .Values.tests | indent 12 }}
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
nodeSelector:
node-role.kubernetes.io/master: ""

57
charts/tempest-pushgateway/templates/prometheusrule.yaml

@ -0,0 +1,57 @@
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
namespace: {{ .Release.Namespace }}
name: {{ include "tempest-pushgateway.fullname" . }}
labels:
{{ include "tempest-pushgateway.labels" . | indent 4 }}
spec:
groups:
- name: tempest
rules:
- alert: TempestTestNotRunning
expr: |
time() - tempest_last_run_unixtime > 900
labels:
severity: P3
annotations:
summary: "[`{{`{{$labels.instance}}`}}`] Tempest not reporting"
description: >
Tempest has not reported in for over 15 minutes which means that the
tests are not running and the state of the cloud is unknown.
- alert: TempestTestFailure
expr: |
tempest_last_run_result{tempest_last_run_result="success"} != 1
labels:
severity: P5
annotations:
summary: "[`{{`{{$labels.instance}}`}}`] Tempest test failure"
description: >
The test `{{`{{$labels.instance}}`}}` has failed in it's most recent
run.
- alert: TempestTestFailure
for: 8m
expr: |
tempest_last_run_result{tempest_last_run_result="success"} != 1
labels:
severity: P4
annotations:
summary: "[`{{`{{$labels.instance}}`}}`] Tempest test failure"
description: >
The test `{{`{{$labels.instance}}`}}` has failed in it's most recent
run for 8 minutes.
- alert: TempestTestFailure
for: 13m
expr: |
tempest_last_run_result{tempest_last_run_result="success"} != 1
labels:
severity: P3
annotations:
summary: "[`{{`{{$labels.instance}}`}}`] Tempest test failure"
description: >
The test `{{`{{$labels.instance}}`}}` has failed in it's most recent
run for 13 minutes.

10
charts/tempest-pushgateway/templates/secret.yaml

@ -0,0 +1,10 @@
---
apiVersion: v1
kind: Secret
metadata:
namespace: {{ .Release.Namespace }}
name: {{ include "tempest-pushgateway.fullname" . }}
labels:
{{- include "tempest-pushgateway.labels" . | indent 4 }}
stringData:
{{ toYaml .Values.env | indent 2 -}}

15
charts/tempest-pushgateway/values.yaml

@ -0,0 +1,15 @@
---
image: vexxhost/tempest-pushgateway:latest
tests:
- tempest.api.compute.servers.test_create_server.ServersTestBootFromVolume.test_verify_server_details
- heat_tempest_plugin.tests.api.test_heat_api.resources_create_stack_with_resources.test_request
- tempest_horizon.tests.scenario.test_dashboard_basic_ops.TestDashboardBasicOps
env:
OS_AUTH_TYPE: password
OS_AUTH_URL: http://keystone.openstack.svc.cluster.local
OS_USER_DOMAIN_ID: default
OS_PROJECT_DOMAIN_ID: default
TEMPEST_PROMETHEUS: prometheus-pushgateway:9091
TEMPEST_HORIZON_URL: http://horizon.openstack.svc.cluster.local
Loading…
Cancel
Save