mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
stable/grafana test (#12604)
Signed-off-by: Steven Chung <schung@mesosphere.io>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
481557acff
commit
d6421c14ee
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: grafana
|
||||
version: 3.0.1
|
||||
version: 3.1.0
|
||||
appVersion: 6.0.2
|
||||
kubeVersion: "^1.8.0-0"
|
||||
description: The leading tool for querying and visualizing time series and metrics.
|
||||
|
||||
@@ -106,6 +106,9 @@ The command removes all the Kubernetes components associated with the chart and
|
||||
| `rbac.pspEnabled` | Create PodSecurityPolicy (with `rbac.create`, grant roles permissions as well) | `true` |
|
||||
| `rbac.pspUseAppArmor` | Enforce AppArmor in created PodSecurityPolicy (requires `rbac.pspEnabled`) | `true` |
|
||||
| `command` | Define command to be executed by grafana container at startup | `nil` |
|
||||
| `testFramework.image` | `test-framework` image repository. | `dduportal/bats` |
|
||||
| `testFramework.tag` | `test-framework` image tag. | `0.4.0` |
|
||||
|
||||
|
||||
### Example of extraVolumeMounts
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "grafana.fullname" . }}-test
|
||||
labels:
|
||||
app: {{ template "grafana.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
data:
|
||||
run.sh: |-
|
||||
@test "Test Health" {
|
||||
url="http://{{ template "grafana.fullname" . }}/api/health"
|
||||
|
||||
code=$(curl -s -o /dev/null -I -w "%{http_code}" $url)
|
||||
[ "$code" == "200" ]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: {{ template "grafana.fullname" . }}-test
|
||||
labels:
|
||||
app: {{ template "grafana.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
annotations:
|
||||
"helm.sh/hook": test-success
|
||||
spec:
|
||||
initContainers:
|
||||
- name: test-framework
|
||||
image: "{{ .Values.testFramework.image}}:{{ .Values.testFramework.tag }}"
|
||||
command:
|
||||
- "bash"
|
||||
- "-c"
|
||||
- |
|
||||
set -ex
|
||||
# copy bats to tools dir
|
||||
cp -R /usr/local/libexec/ /tools/bats/
|
||||
volumeMounts:
|
||||
- mountPath: /tools
|
||||
name: tools
|
||||
containers:
|
||||
- name: {{ .Release.Name }}-test
|
||||
image: "{{ .Values.testFramework.image}}:{{ .Values.testFramework.tag }}"
|
||||
command: ["/tools/bats/bats", "-t", "/tests/run.sh"]
|
||||
volumeMounts:
|
||||
- mountPath: /tests
|
||||
name: tests
|
||||
readOnly: true
|
||||
- mountPath: /tools
|
||||
name: tools
|
||||
volumes:
|
||||
- name: tests
|
||||
configMap:
|
||||
name: {{ template "grafana.fullname" . }}-test
|
||||
- name: tools
|
||||
emptyDir: {}
|
||||
restartPolicy: Never
|
||||
@@ -29,6 +29,10 @@ image:
|
||||
tag: 6.0.2
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
testFramework:
|
||||
image: "dduportal/bats"
|
||||
tag: "0.4.0"
|
||||
|
||||
## Optionally specify an array of imagePullSecrets.
|
||||
## Secrets must be manually created in the namespace.
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||
|
||||
Reference in New Issue
Block a user