mirror of
https://github.com/bitnami/charts.git
synced 2026-04-02 07:17:26 +08:00
[bitnami/prometheus] Add chart (#15543)
* [bitnami/prometheus] Add chart --------- Signed-off-by: Fran Mulero <fmulero@vmware.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
74
.vib/prometheus/goss/goss.yaml
Normal file
74
.vib/prometheus/goss/goss.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
command:
|
||||
check-no-capabilities:
|
||||
exec: cat /proc/1/status
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- "CapInh: 0000000000000000"
|
||||
- "CapPrm: 0000000000000000"
|
||||
- "CapEff: 0000000000000000"
|
||||
- "CapBnd: 0000000000000000"
|
||||
- "CapAmb: 0000000000000000"
|
||||
{{- $uid := .Vars.server.podSecurityContext.runAsUser }}
|
||||
{{- $gid := .Vars.server.podSecurityContext.fsGroup }}
|
||||
check-user-info:
|
||||
# The UID and GID should always be either the one specified as vars (always a bigger number that the default)
|
||||
# or the one randomly defined by openshift (larger values). Otherwise, the chart is still using the default value.
|
||||
exec: if [ $(id -u) -lt {{ $uid }} ] || [ $(id -G | awk '{print $2}') -lt {{ $gid }} ]; then exit 1; fi
|
||||
exit-status: 0
|
||||
{{ if .Vars.server.serviceAccount.automountServiceAccountToken }}
|
||||
check-sa:
|
||||
exec: cat /var/run/secrets/kubernetes.io/serviceaccount/token | cut -d '.' -f 2 | xargs -I '{}' echo '{}====' | fold -w 4 | sed '$ d' | tr -d '\n' | base64 -d
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- /serviceaccount.*name.*{{.Env.BITNAMI_APP_NAME }}/
|
||||
{{ end }}
|
||||
file:
|
||||
/opt/bitnami/prometheus/conf/{{ .Vars.server.existingConfigmapKey }}:
|
||||
exists: true
|
||||
contains:
|
||||
- "job_name: alertmanager"
|
||||
- "{{ (first .Vars.server.extraScrapeConfigs).job_name }}"
|
||||
/opt/bitnami/prometheus/conf/rules.yaml:
|
||||
exists: true
|
||||
contains:
|
||||
- "{{ (first .Vars.server.alertingRules.groups).name }}"
|
||||
{{.Vars.server.persistence.mountPath}}:
|
||||
exists: true
|
||||
filetype: directory
|
||||
mode: "2775"
|
||||
owner: root
|
||||
/proc/1/cmdline:
|
||||
exists: true
|
||||
contains:
|
||||
- "--enable-feature={{ .Vars.server.enableFeatures | first }}"
|
||||
http:
|
||||
http://localhost:{{ .Vars.server.containerPorts.http }}/-/ready:
|
||||
status: 200
|
||||
body:
|
||||
- "Prometheus Server is Ready."
|
||||
http://localhost:{{ .Vars.server.containerPorts.http }}/-/healthy:
|
||||
status: 200
|
||||
body:
|
||||
- "Prometheus Server is Healthy."
|
||||
{{- if .Vars.alertmanager.enabled }}
|
||||
http://prometheus-alertmanager:{{ .Vars.alertmanager.service.ports.http }}/-/healthy:
|
||||
status: 200
|
||||
body:
|
||||
- "OK"
|
||||
http://localhost:{{ .Vars.server.containerPorts.http }}/api/v1/rules?name={{ (first .Vars.server.alertingRules.groups).name }}:
|
||||
status: 200
|
||||
body:
|
||||
- "{{ (first (first .Vars.server.alertingRules.groups).rules).annotations.summary }}"
|
||||
{{- end }}
|
||||
command:
|
||||
check-config-files:
|
||||
exec: promtool check config /opt/bitnami/prometheus/conf/{{ .Vars.server.existingConfigmapKey }}
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- SUCCESS
|
||||
check-metrics:
|
||||
exec: promtool query instant http://localhost:{{ .Vars.server.containerPorts.http }} prometheus_http_requests_total
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- "/-/healthy"
|
||||
- "/-/ready"
|
||||
Reference in New Issue
Block a user