Compare commits
32 Commits
user-monit
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e0af833bff | ||
![]() |
7c36030329 | ||
![]() |
226156b36a | ||
![]() |
c2f4139315 | ||
![]() |
9e1610443f | ||
![]() |
530acdb363 | ||
![]() |
d5ebb49393 | ||
![]() |
a747f04036 | ||
![]() |
1afef4726f | ||
![]() |
b52f889da1 | ||
![]() |
e47ae75947 | ||
![]() |
753c3dd95f | ||
![]() |
628f64b1e8 | ||
![]() |
a88b2af56d | ||
![]() |
faecd0aa8d | ||
![]() |
909ac9b911 | ||
![]() |
905d5a2d09 | ||
![]() |
0ad1aae355 | ||
![]() |
dbb0cc23da | ||
![]() |
73c8c6435f | ||
![]() |
7385c2af41 | ||
![]() |
4482493d5f | ||
![]() |
00ba693670 | ||
![]() |
3fc8e332ea | ||
![]() |
c58fbd2334 | ||
![]() |
4df31ddaf6 | ||
![]() |
9b00f330b3 | ||
![]() |
7bf01de75f | ||
![]() |
9687f504e1 | ||
![]() |
8e43add4da | ||
![]() |
7a01cc94b6 | ||
![]() |
01fe8162c3 |
21
apps/user-demo.yaml
Normal file
21
apps/user-demo.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: <user>-demo
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
destination:
|
||||||
|
namespace: <user>
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
repoURL: 'https://gitea.training.cluster.acend.ch/<user>/prometheus-training-lab-setup'
|
||||||
|
path: user-demo/
|
||||||
|
targetRevision: main
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- Replace=true
|
21
apps/user-prom-stack.yaml
Normal file
21
apps/user-prom-stack.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: <user>-prom-stack
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
destination:
|
||||||
|
namespace: <user>-monitoring
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
repoURL: 'https://gitea.training.cluster.acend.ch/<user>/prometheus-training-lab-setup'
|
||||||
|
path: charts/user-monitoring/
|
||||||
|
targetRevision: main
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- Replace=true
|
@ -15,7 +15,7 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.1.0
|
version: 0.1.1
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: Role
|
|
||||||
metadata:
|
|
||||||
name: prometheus-{{ .Values.user }}
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources:
|
|
||||||
- services
|
|
||||||
- endpoints
|
|
||||||
- pods
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources:
|
|
||||||
- configmaps
|
|
||||||
verbs: ["get"]
|
|
||||||
- apiGroups:
|
|
||||||
- networking.k8s.io
|
|
||||||
resources:
|
|
||||||
- ingresses
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
@ -16,6 +16,6 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: quay.io/acend/example-web-python
|
- image: quay.io/acend/example-web-python
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: IfNotPresent
|
||||||
name: example-web-python
|
name: example-web-python
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
|
@ -1 +1 @@
|
|||||||
user: user1
|
user: userX # Replace me
|
@ -15,7 +15,7 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.2.0-U+1F992
|
version: 0.2.6
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
{{- define "alertmanager.config-mailcatcher" }}
|
||||||
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1alpha1
|
||||||
|
kind: AlertmanagerConfig
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.user }}-mailcatcher
|
||||||
|
labels:
|
||||||
|
alertmanagerConfig: {{ .Values.user }}-alertmanager
|
||||||
|
spec:
|
||||||
|
route:
|
||||||
|
groupBy: ['job']
|
||||||
|
groupWait: 30s
|
||||||
|
groupInterval: 5m
|
||||||
|
repeatInterval: 12h
|
||||||
|
receiver: 'mailcatcher'
|
||||||
|
receivers:
|
||||||
|
- name: 'mailcatcher'
|
||||||
|
emailConfigs:
|
||||||
|
- to: alert@localhost
|
||||||
|
from: prometheus-operator@localhost
|
||||||
|
smarthost: mailcatcher:1025
|
||||||
|
requireTLS: false
|
||||||
|
{{- end }}
|
@ -0,0 +1,21 @@
|
|||||||
|
{{- define "alertmanager.servicemonitor" }}
|
||||||
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mariadb
|
||||||
|
name: alertmanager
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- interval: 60s
|
||||||
|
port: web
|
||||||
|
scheme: http
|
||||||
|
path: /metrics
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- {{ .Values.user }}-monitoring
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
operated-alertmanager: 'true'
|
||||||
|
{{- end }}
|
@ -1,10 +1,54 @@
|
|||||||
{{- define "alertmanager.alertmanager" }}
|
{{- define "alertmanager.alertmanager" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: Alertmanager
|
kind: Alertmanager
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ .Values.user }}-am
|
app.kubernetes.io/name: {{ .Values.user }}-alertmanager
|
||||||
name: {{ .Values.user }}-am
|
name: {{ .Values.user }}-alertmanager
|
||||||
spec: {}
|
spec:
|
||||||
|
alertmanagerConfigNamespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
user: {{ .Values.user }}-alertmanager
|
||||||
|
alertmanagerConfigSelector:
|
||||||
|
matchLabels:
|
||||||
|
alertmanagerConfig: {{ .Values.user }}-alertmanager
|
||||||
|
image: quay.io/prometheus/alertmanager:v0.25.0
|
||||||
|
replicas: 1
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 40Mi
|
||||||
|
storage:
|
||||||
|
volumeClaimTemplate:
|
||||||
|
spec:
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 100Mi
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
haproxy.org/auth-secret: basic-auth
|
||||||
|
haproxy.org/auth-type: basic-auth
|
||||||
|
haproxy.org/auth-realm: Authentication Required
|
||||||
|
name: {{ .Values.user }}-alertmanager
|
||||||
|
spec:
|
||||||
|
ingressClassName: haproxy
|
||||||
|
rules:
|
||||||
|
- host: {{ .Values.user }}-alertmanager.training.cluster.acend.ch
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: alertmanager-operated
|
||||||
|
port:
|
||||||
|
number: 9093
|
||||||
|
path: /
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- {{ .Values.user }}-alertmanager.training.cluster.acend.ch
|
||||||
|
secretName: acend-wildcard
|
||||||
{{- end }}
|
{{- end }}
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "blackboxexporter.cm" }}
|
{{- define "blackboxexporter.cm" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "blackboxexporter.deploy" }}
|
{{- define "blackboxexporter.deploy" }}
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
{{- define "blackboxexporter.svc" }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: blackbox
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: blackbox-exporter
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 9115
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 9115
|
||||||
|
selector:
|
||||||
|
app.kubernetes.io/name: blackbox-exporter
|
||||||
|
type: ClusterIP
|
||||||
|
{{- end }}
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "grafana.dashboardprovider" }}
|
{{- define "grafana.dashboardprovider" }}
|
||||||
|
---
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "grafana.datasource" }}
|
{{- define "grafana.datasource" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
type: Opaque
|
type: Opaque
|
||||||
@ -15,6 +16,9 @@ stringData:
|
|||||||
access: proxy
|
access: proxy
|
||||||
editable: false
|
editable: false
|
||||||
type: prometheus
|
type: prometheus
|
||||||
url: http://thanos-query.{{ .Values.user }}-monitoring.svc.cluster.local:10902
|
url: http://thanos-query:10902
|
||||||
version: 1
|
version: 1
|
||||||
|
{{- if .Values.grafana.datasources }}
|
||||||
|
{{- toYaml .Values.grafana.datasources | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "grafana.deploy" }}
|
{{- define "grafana.deploy" }}
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "grafana.ingress" }}
|
{{- define "grafana.ingress" }}
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "grafana.rolebinding" }}
|
{{- define "grafana.rolebinding" }}
|
||||||
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "grafana.sa" }}
|
{{- define "grafana.sa" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
{{- define "grafana.servicemonitor" }}
|
||||||
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: grafana-monitor
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- basicAuth:
|
||||||
|
password:
|
||||||
|
name: basic-auth
|
||||||
|
key: {{ .Values.user }}
|
||||||
|
username:
|
||||||
|
name: basic-auth
|
||||||
|
key: grafana_user
|
||||||
|
interval: 60s
|
||||||
|
port: http
|
||||||
|
scheme: http
|
||||||
|
path: /metrics
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: grafana
|
||||||
|
{{- end }}
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "grafana.svc" }}
|
{{- define "grafana.svc" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
{{- define "mailcatcher.deploy" }}
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mailcatcher
|
||||||
|
name: mailcatcher
|
||||||
|
namespace: {{ .Values.user }}-monitoring
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: mailcatcher
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mailcatcher
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: sj26/mailcatcher:v0.9.0
|
||||||
|
name: mailcatcher
|
||||||
|
ports:
|
||||||
|
- containerPort: 1080
|
||||||
|
name: http
|
||||||
|
- containerPort: 1025
|
||||||
|
name: smtp
|
||||||
|
{{- end }}
|
@ -0,0 +1,30 @@
|
|||||||
|
{{- define "mailcatcher.ingress" }}
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
haproxy.org/auth-secret: basic-auth
|
||||||
|
haproxy.org/auth-type: basic-auth
|
||||||
|
haproxy.org/auth-realm: Authentication Required
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: {{ .Values.user }}-mailcatcher
|
||||||
|
name: {{ .Values.user }}-mailcatcher
|
||||||
|
spec:
|
||||||
|
ingressClassName: haproxy
|
||||||
|
rules:
|
||||||
|
- host: {{ .Values.user }}-mailcatcher.training.cluster.acend.ch
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: mailcatcher
|
||||||
|
port:
|
||||||
|
number: 1080
|
||||||
|
path: /
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- {{ .Values.user }}-mailcatcher.training.cluster.acend.ch
|
||||||
|
secretName: acend-wildcard
|
||||||
|
{{- end }}
|
22
charts/user-monitoring/templates/_user-mailcatcher-svc.yaml
Normal file
22
charts/user-monitoring/templates/_user-mailcatcher-svc.yaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{{- define "mailcatcher.svc" }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mailcatcher
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mailcatcher
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 1080
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: http
|
||||||
|
- name: smtp
|
||||||
|
port: 1025
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: smtp
|
||||||
|
selector:
|
||||||
|
app.kubernetes.io/name: mailcatcher
|
||||||
|
type: ClusterIP
|
||||||
|
{{- end }}
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "prometheus.ingress" }}
|
{{- define "prometheus.ingress" }}
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "prometheus.role" }}
|
{{- define "prometheus.role" }}
|
||||||
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "prometheus.rolebinding" }}
|
{{- define "prometheus.rolebinding" }}
|
||||||
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "prometheus.sa" }}
|
{{- define "prometheus.sa" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
{{- define "prometheus.servicemonitor" }}
|
||||||
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: prometheus
|
||||||
|
user: {{ .Values.user }}
|
||||||
|
name: {{ .Values.user }}-prometheus-servicemonitor
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- path: /metrics
|
||||||
|
port: web
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- {{ .Values.user }}-monitoring
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
operated-prometheus: 'true'
|
||||||
|
{{- end }}
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "prometheus.prometheus" }}
|
{{- define "prometheus.prometheus" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: Prometheus
|
kind: Prometheus
|
||||||
metadata:
|
metadata:
|
||||||
@ -6,7 +7,11 @@ metadata:
|
|||||||
app.kubernetes.io/name: prometheus
|
app.kubernetes.io/name: prometheus
|
||||||
name: prometheus
|
name: prometheus
|
||||||
spec:
|
spec:
|
||||||
scrapeInterval: 10s
|
{{- if .Values.query.enabled }}
|
||||||
|
thanos:
|
||||||
|
image: quay.io/thanos/thanos:v0.32.3
|
||||||
|
{{- end }}
|
||||||
|
scrapeInterval: 60s
|
||||||
serviceAccountName: prometheus-{{ .Values.user }}
|
serviceAccountName: prometheus-{{ .Values.user }}
|
||||||
serviceMonitorNamespaceSelector:
|
serviceMonitorNamespaceSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "pushgateway.deploy" }}
|
{{- define "pushgateway.deploy" }}
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "pushgateway.servicemonitor" }}
|
{{- define "pushgateway.servicemonitor" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "pushgateway.svc" }}
|
{{- define "pushgateway.svc" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "query.deploy" }}
|
{{- define "query.deploy" }}
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@ -24,9 +25,11 @@ spec:
|
|||||||
- --query.replica-label=thanos_ruler_replica
|
- --query.replica-label=thanos_ruler_replica
|
||||||
- --endpoint=prometheus-operated.{{ .Values.user }}-monitoring.svc.cluster.local:10901
|
- --endpoint=prometheus-operated.{{ .Values.user }}-monitoring.svc.cluster.local:10901
|
||||||
- --endpoint=thanos-ruler-operated.{{ .Values.user }}-monitoring.svc.cluster.local:10901
|
- --endpoint=thanos-ruler-operated.{{ .Values.user }}-monitoring.svc.cluster.local:10901
|
||||||
- --endpoint=prometheus-operated.monitoring.svc.cluster.local:10901
|
- --store=dnssrv+prometheus-operated.{{ .Values.user }}-monitoring.svc.cluster.local
|
||||||
|
- --store=dnssrv+_web._tcp.prometheus-operated.{{ .Values.user }}-monitoring.svc.cluster.local
|
||||||
|
- --store=dnssrv+_grpc._tcp.kube-prometheus-stack-thanos-discovery.monitoring.svc.cluster.local
|
||||||
- --store.unhealthy-timeout=3d
|
- --store.unhealthy-timeout=3d
|
||||||
image: quay.io/thanos/thanos:v0.25.1
|
image: quay.io/thanos/thanos:v0.32.3
|
||||||
name: thanos-query
|
name: thanos-query
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 10902
|
- containerPort: 10902
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "query.ingress" }}
|
{{- define "query.ingress" }}
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "query.svc" }}
|
{{- define "query.svc" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "ruler.ingress" }}
|
{{- define "ruler.ingress" }}
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{{- define "ruler.ruler" }}
|
{{- define "ruler.ruler" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ThanosRuler
|
kind: ThanosRuler
|
||||||
metadata:
|
metadata:
|
||||||
@ -6,12 +7,26 @@ metadata:
|
|||||||
app.kubernetes.io/name: thanos-ruler
|
app.kubernetes.io/name: thanos-ruler
|
||||||
name: thanos-ruler
|
name: thanos-ruler
|
||||||
spec:
|
spec:
|
||||||
alertQueryUrl: {{ .Values.user }}-thanos-query.training.cluster.acend.ch
|
image: quay.io/thanos/thanos:v0.28.1
|
||||||
evaluationInterval: 10s
|
evaluationInterval: 10s
|
||||||
queryEndpoints:
|
queryEndpoints:
|
||||||
- thanos-query.{{ .Values.user }}-monitoring.svc.cluster.local:10902
|
- dnssrv+_http._tcp.thanos-query:10902
|
||||||
ruleSelector: {}
|
ruleSelector: {}
|
||||||
ruleNamespaceSelector:
|
ruleNamespaceSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
user: {{ .Values.user }}
|
user: {{ .Values.user }}
|
||||||
|
alertmanagersConfig:
|
||||||
|
key: alertmanager-configs.yaml
|
||||||
|
name: thanosruler-alertmanager-config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: thanosruler-alertmanager-config
|
||||||
|
stringData:
|
||||||
|
alertmanager-configs.yaml: |-
|
||||||
|
alertmanagers:
|
||||||
|
- static_configs:
|
||||||
|
- "dnssrv+_web._tcp.alertmanager-operated.{{ .Values.user }}-monitoring.svc.cluster.local"
|
||||||
|
api_version: v2
|
||||||
{{- end }}
|
{{- end }}
|
@ -2,6 +2,18 @@
|
|||||||
|
|
||||||
{{- if .Values.alertmanager.enabled }}
|
{{- if .Values.alertmanager.enabled }}
|
||||||
{{- template "alertmanager.alertmanager" . }}
|
{{- template "alertmanager.alertmanager" . }}
|
||||||
|
{{- template "alertmanager.servicemonitor" . }}
|
||||||
|
{{- template "alertmanager.config-mailcatcher" . }}
|
||||||
|
{{- template "mailcatcher.deploy" . }}
|
||||||
|
{{- template "mailcatcher.svc" . }}
|
||||||
|
{{- template "mailcatcher.ingress" . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
# blackboxexporter
|
||||||
|
{{- if .Values.blackboxexporter.enabled }}
|
||||||
|
{{- template "blackboxexporter.cm" . }}
|
||||||
|
{{- template "blackboxexporter.deploy" . }}
|
||||||
|
{{- template "blackboxexporter.svc" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
# grafana
|
# grafana
|
||||||
@ -12,6 +24,7 @@
|
|||||||
{{- template "grafana.svc" . }}
|
{{- template "grafana.svc" . }}
|
||||||
{{- template "grafana.sa" . }}
|
{{- template "grafana.sa" . }}
|
||||||
{{- template "grafana.deploy" . }}
|
{{- template "grafana.deploy" . }}
|
||||||
|
{{- template "grafana.servicemonitor" . }}
|
||||||
{{- template "grafana.ingress" . }}
|
{{- template "grafana.ingress" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
@ -19,6 +32,7 @@
|
|||||||
{{- if .Values.prometheus.enabled }}
|
{{- if .Values.prometheus.enabled }}
|
||||||
{{- template "prometheus.ingress" . }}
|
{{- template "prometheus.ingress" . }}
|
||||||
{{- template "prometheus.prometheus" . }}
|
{{- template "prometheus.prometheus" . }}
|
||||||
|
{{- template "prometheus.servicemonitor" . }}
|
||||||
{{- template "prometheus.role" . }}
|
{{- template "prometheus.role" . }}
|
||||||
{{- template "prometheus.rolebinding" . }}
|
{{- template "prometheus.rolebinding" . }}
|
||||||
{{- template "prometheus.sa" . }}
|
{{- template "prometheus.sa" . }}
|
||||||
|
@ -2,6 +2,7 @@ apiVersion: v1
|
|||||||
data:
|
data:
|
||||||
admin: JDEkSzNRZUlsOHAkZVZZb1h2RERNWk40b3RJT2tBc3AwLw== # $(openssl passwd -1 admin)
|
admin: JDEkSzNRZUlsOHAkZVZZb1h2RERNWk40b3RJT2tBc3AwLw== # $(openssl passwd -1 admin)
|
||||||
{{ .Values.user }}: JDEkSzNRZUlsOHAkZVZZb1h2RERNWk40b3RJT2tBc3AwLw== # $(openssl passwd -1 admin)
|
{{ .Values.user }}: JDEkSzNRZUlsOHAkZVZZb1h2RERNWk40b3RJT2tBc3AwLw== # $(openssl passwd -1 admin)
|
||||||
|
grafana_user: {{ .Values.user | b64enc }}
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
@ -1,25 +1,22 @@
|
|||||||
user: user1
|
user: <user> # Replace me
|
||||||
|
|
||||||
# alertmanager
|
|
||||||
alertmanager:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
# grafana
|
|
||||||
grafana:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
# prometheus
|
# prometheus
|
||||||
prometheus:
|
prometheus:
|
||||||
enabled: true
|
enabled: false
|
||||||
|
|
||||||
# pushgeitwey
|
|
||||||
pushgateway:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
# thanos-ruler
|
|
||||||
ruler:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
# thanos-query
|
# thanos-query
|
||||||
query:
|
query:
|
||||||
enabled: true
|
enabled: false
|
||||||
|
# grafana
|
||||||
|
grafana:
|
||||||
|
enabled: false
|
||||||
|
# blackboxexporter
|
||||||
|
blackboxexporter:
|
||||||
|
enabled: false
|
||||||
|
# pushgateway
|
||||||
|
pushgateway:
|
||||||
|
enabled: false
|
||||||
|
# alertmanager
|
||||||
|
alertmanager:
|
||||||
|
enabled: false
|
||||||
|
# thanos-ruler
|
||||||
|
ruler:
|
||||||
|
enabled: false
|
||||||
|
3
user-demo/README.md
Normal file
3
user-demo/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Readme
|
||||||
|
|
||||||
|
This is the location for the user demo app.
|
Loading…
x
Reference in New Issue
Block a user