Skip to content

Commit

Permalink
Prometheus stack (#81)
Browse files Browse the repository at this point in the history
* Make prometheus-stack easier to use

* Auto update of README.md files

---------

Co-authored-by: Victor Getz <sd>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
victorgetz and github-actions[bot] authored Dec 13, 2023
1 parent 3962566 commit bc032c6
Show file tree
Hide file tree
Showing 14 changed files with 264 additions and 98 deletions.
4 changes: 2 additions & 2 deletions charts/cert-manager/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# cert-manager

![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square)
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square)

Wrapper chart for cert-manager. Deploys a ClusterIssuer resource to bootstrap Let's encrypt cert generation

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://charts.jetstack.io | cert-manager | v1.11.3 |
| https://charts.jetstack.io | cert-manager | v1.13.2 |

## Values

Expand Down
2 changes: 1 addition & 1 deletion charts/crds/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# crds

![Version: 1.5.1](https://img.shields.io/badge/Version-1.5.1-informational?style=flat-square)
![Version: 1.6.3](https://img.shields.io/badge/Version-1.6.3-informational?style=flat-square)

This chart deploys common `CustomResourceDefinitions` for iits-consulting only projects.
With this we avoid a typical catch-22, e.g. where you can not use `traefik`
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
version: 43.1.3
description: A complete monitoring/alerting stack with Grafana Prometheus Alertmanager
name: prometheus-stack
version: 43.1.6
version: 43.2.0
29 changes: 8 additions & 21 deletions charts/prometheus-stack/README-OTC.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,16 @@
prometheus-stack:
namespace: monitoring
repoURL: "https://charts.iits.tech"
targetRevision: "43.1.3-no-default-storage"
valueFile: "value-files/prometheus-stack/values.yaml"
syncOptions:
- ServerSideApply=true
targetRevision: "43.2.0"
ignoreDifferences:
- jsonPointers:
- /imagePullSecrets
kind: ServiceAccount
```
values.yaml
```yaml
prometheusStack:
prometheus:
prometheusSpec:
externalUrl: https://admin.{{.Values.projectValues.rootDomain}}/prometheus
serviceMonitorSelectorNilUsesHelmValues: false
grafana:
grafana.ini:
server:
root_url: https://admin.{{.Values.projectValues.rootDomain}}/grafana
alertmanager:
# config:
# global:
# slack_api_url: "REPLACE_ME"
syncOptions:
- ServerSideApply=true
parameters:
global.alertmanager.host: "admin.{{.Values.projectValues.rootDomain}}"
global.prometheus.host: "admin.{{.Values.projectValues.rootDomain}}"
global.grafana.host: "admin.{{.Values.projectValues.rootDomain}}"
prometheusStack.grafana.grafana\\.ini.server.security.admin_password: "REPLACE_ME"
```
31 changes: 27 additions & 4 deletions charts/prometheus-stack/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# prometheus-stack

![Version: 43.1.5](https://img.shields.io/badge/Version-43.1.5-informational?style=flat-square)
![Version: 43.2.0](https://img.shields.io/badge/Version-43.2.0-informational?style=flat-square)

A complete monitoring/alerting stack with Grafana Prometheus Alertmanager

Expand All @@ -14,8 +14,9 @@ A complete monitoring/alerting stack with Grafana Prometheus Alertmanager

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| ingressRoute.adminDomain | string | `"admin.my-domain.com"` | |
| ingressRoute.entryPointName | string | `"after-proxy"` | |
| global.alertmanager.host | string | `"REPLACE_ME"` | |
| global.grafana.host | string | `"REPLACE_ME"` | |
| global.prometheus.host | string | `"REPLACE_ME"` | |
| prometheusStack.alertmanager.alertmanagerSpec.resources.requests.cpu | string | `"5m"` | |
| prometheusStack.alertmanager.alertmanagerSpec.resources.requests.memory | string | `"100Mi"` | |
| prometheusStack.alertmanager.alertmanagerSpec.routePrefix | string | `"/alertmanager"` | |
Expand Down Expand Up @@ -64,16 +65,38 @@ A complete monitoring/alerting stack with Grafana Prometheus Alertmanager
| prometheusStack.defaultRules.rules.prometheus | bool | `true` | |
| prometheusStack.defaultRules.rules.prometheusOperator | bool | `true` | |
| prometheusStack.defaultRules.rules.time | bool | `true` | |
| prometheusStack.grafana."grafana.ini"."auth.basic".enabled | bool | `true` | |
| prometheusStack.grafana."grafana.ini".auth.disable_login_form | bool | `false` | |
| prometheusStack.grafana."grafana.ini".security.admin_password | string | `"REPLACE_ME"` | |
| prometheusStack.grafana."grafana.ini".security.disable_initial_admin_creation | bool | `false` | |
| prometheusStack.grafana."grafana.ini".server.root_url | string | `"https://{{$.Values.global.grafana.host}}/grafana"` | |
| prometheusStack.grafana."grafana.ini".server.serve_from_sub_path | bool | `true` | |
| prometheusStack.ingress.alertmanager.annotations."traefik.ingress.kubernetes.io/router.entrypoints" | string | `"after-proxy"` | |
| prometheusStack.ingress.alertmanager.annotations."traefik.ingress.kubernetes.io/router.middlewares" | string | `"{{.Release.Namespace}}-strip-prefix-{{ .Release.Name }}@kubernetescrd"` | |
| prometheusStack.ingress.alertmanager.enabled | bool | `true` | |
| prometheusStack.ingress.alertmanager.host | string | `"{{$.Values.global.alertmanager.host}}"` | |
| prometheusStack.ingress.grafana.annotations."cert-manager.io/cluster-issuer" | string | `"letsencrypt"` | |
| prometheusStack.ingress.grafana.annotations."traefik.ingress.kubernetes.io/router.entrypoints" | string | `"websecure"` | |
| prometheusStack.ingress.grafana.annotations."traefik.ingress.kubernetes.io/router.tls" | string | `"true"` | |
| prometheusStack.ingress.grafana.className | string | `"traefik"` | |
| prometheusStack.ingress.grafana.enabled | bool | `true` | |
| prometheusStack.ingress.grafana.host | string | `"{{$.Values.global.grafana.host}}"` | |
| prometheusStack.ingress.grafana.tls[0].hosts[0] | string | `"{{$.Values.global.grafana.host}}"` | |
| prometheusStack.ingress.prometheus.annotations."traefik.ingress.kubernetes.io/router.entrypoints" | string | `"after-proxy"` | |
| prometheusStack.ingress.prometheus.enabled | bool | `true` | |
| prometheusStack.ingress.prometheus.host | string | `"{{$.Values.global.prometheus.host}}"` | |
| prometheusStack.kubeControllerManager.enabled | bool | `false` | |
| prometheusStack.kubeProxy.enabled | bool | `false` | |
| prometheusStack.kubeScheduler.enabled | bool | `false` | |
| prometheusStack.kubelet.enabled | bool | `true` | |
| prometheusStack.nameOverride | string | `"prometheus-stack"` | |
| prometheusStack.prometheus.prometheusSpec.podMonitorSelector.matchLabels."argocd.argoproj.io/instance" | string | `"my-app"` | |
| prometheusStack.prometheus.prometheusSpec.externalUrl | string | `"https://{{$.Values.global.prometheus.host}}/prometheus"` | |
| prometheusStack.prometheus.prometheusSpec.podMonitorSelector | string | `nil` | |
| prometheusStack.prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues | bool | `false` | |
| prometheusStack.prometheus.prometheusSpec.resources.requests.cpu | string | `"60m"` | |
| prometheusStack.prometheus.prometheusSpec.resources.requests.memory | string | `"2255Mi"` | |
| prometheusStack.prometheus.prometheusSpec.routePrefix | string | `"/prometheus"` | |
| prometheusStack.prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues | bool | `false` | |
| prometheusStack.prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.accessModes[0] | string | `"ReadWriteOnce"` | |
| prometheusStack.prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.resources.requests.storage | string | `"30G"` | |
| prometheusStack.prometheusOperator.admissionWebhooks.enabled | bool | `false` | |
Expand Down
58 changes: 58 additions & 0 deletions charts/prometheus-stack/templates/ingress/alertmanager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{- with .Values.prometheusStack.ingress.alertmanager}}
{{- if .enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{$.Release.Name}}-alertmanager
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .className | default "traefik" }}
{{- if .tls }}
tls:
{{- range .tls }}
{{- $certSecretName := .secretName | default (printf "%s-%s" $.Release.Name "cert")}}
{{- if .hosts }}
{{- range .hosts }}
- hosts:
- {{ tpl (toYaml .) $ }}
secretName: {{ $certSecretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- if .hosts }}
{{- range .hosts }}
- host: {{ tpl (toYaml .host) $ }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType | default "Prefix"}}
backend:
service:
name: {{$.Release.Name}}
port:
number: {{ $.Values.prometheusStack.alertmanager.service.port }}
{{- end }}
{{- end }}
{{- else }}
- host: {{ tpl (toYaml .host) $ }}
http:
paths:
- path: "/alertmanager"
pathType: "Prefix"
backend:
service:
name: {{$.Release.Name}}-alertmanager
port:
number: {{ $.Values.prometheusStack.alertmanager.service.port }}
{{- end }}
{{- end }}
{{- end }}
58 changes: 58 additions & 0 deletions charts/prometheus-stack/templates/ingress/grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{- with .Values.prometheusStack.ingress.grafana}}
{{- if .enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{$.Release.Name}}-grafana
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .className | default "traefik" }}
{{- if .tls }}
tls:
{{- range .tls }}
{{- $certSecretName := .secretName | default (printf "%s-%s" $.Release.Name "cert")}}
{{- if .hosts }}
{{- range .hosts }}
- hosts:
- {{ tpl (toYaml .) $ }}
secretName: {{ $certSecretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- if .hosts }}
{{- range .hosts }}
- host: {{ tpl (toYaml .host) $ }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType | default "Prefix"}}
backend:
service:
name: {{$.Release.Name}}
port:
number: {{ $.Values.prometheusStack.grafana.service.port }}
{{- end }}
{{- end }}
{{- else }}
- host: {{ tpl (toYaml .host) $ }}
http:
paths:
- path: "/grafana"
pathType: "Prefix"
backend:
service:
name: {{$.Release.Name}}-grafana
port:
number: {{ $.Values.prometheusStack.grafana.service.port }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{- if eq .Values.prometheusStack.ingress.grafana.className "traefik" }}
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: strip-prefix-{{ .Release.Name }}
spec:
stripPrefix:
prefixes:
- "/grafana"
- "/grafana"
{{- end }}
58 changes: 58 additions & 0 deletions charts/prometheus-stack/templates/ingress/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{- with .Values.prometheusStack.ingress.prometheus}}
{{- if .enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{$.Release.Name}}-prometheus
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .className | default "traefik" }}
{{- if .tls }}
tls:
{{- range .tls }}
{{- $certSecretName := .secretName | default (printf "%s-%s" $.Release.Name "cert")}}
{{- if .hosts }}
{{- range .hosts }}
- hosts:
- {{ tpl (toYaml .) $ }}
secretName: {{ $certSecretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- if .hosts }}
{{- range .hosts }}
- host: {{ tpl (toYaml .host) $ }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType | default "Prefix"}}
backend:
service:
name: {{$.Release.Name}}
port:
number: {{ $.Values.prometheusStack.prometheus.service.port }}
{{- end }}
{{- end }}
{{- else }}
- host: {{ tpl (toYaml .host) $ }}
http:
paths:
- path: "/prometheus"
pathType: "Prefix"
backend:
service:
name: {{$.Release.Name}}-prometheus
port:
number: {{ $.Values.prometheusStack.prometheus.service.port }}
{{- end }}
{{- end }}
{{- end }}
21 changes: 0 additions & 21 deletions charts/prometheus-stack/templates/route/route-alertmanager.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions charts/prometheus-stack/templates/route/route-grafana.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions charts/prometheus-stack/templates/route/route-prometheus.yaml

This file was deleted.

Loading

0 comments on commit bc032c6

Please sign in to comment.