Compare commits
No commits in common. "main" and "user-monitoring-0.2.2" have entirely different histories.
main
...
user-monit
@ -1,21 +0,0 @@
|
||||
---
|
||||
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
|
@ -1,21 +0,0 @@
|
||||
---
|
||||
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
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.1
|
||||
version: 0.1.0
|
||||
|
||||
# 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
|
||||
|
20
charts/user-monitoring-demo/demo-role.yaml
Normal file
20
charts/user-monitoring-demo/demo-role.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
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:
|
||||
containers:
|
||||
- image: quay.io/acend/example-web-python
|
||||
imagePullPolicy: IfNotPresent
|
||||
imagePullPolicy: Always
|
||||
name: example-web-python
|
||||
restartPolicy: Always
|
||||
|
@ -1 +1 @@
|
||||
user: userX # Replace me
|
||||
user: user1
|
@ -15,7 +15,7 @@ type: application
|
||||
# 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.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.2.6
|
||||
version: 0.2.2
|
||||
|
||||
# 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
|
||||
|
@ -1,23 +0,0 @@
|
||||
{{- 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 }}
|
@ -1,21 +0,0 @@
|
||||
{{- 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 }}
|
@ -4,51 +4,7 @@ apiVersion: monitoring.coreos.com/v1
|
||||
kind: Alertmanager
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ .Values.user }}-alertmanager
|
||||
name: {{ .Values.user }}-alertmanager
|
||||
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
|
||||
app.kubernetes.io/name: {{ .Values.user }}-am
|
||||
name: {{ .Values.user }}-am
|
||||
spec: {}
|
||||
{{- end }}
|
@ -1,18 +0,0 @@
|
||||
{{- 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 }}
|
@ -16,9 +16,6 @@ stringData:
|
||||
access: proxy
|
||||
editable: false
|
||||
type: prometheus
|
||||
url: http://thanos-query:10902
|
||||
url: http://thanos-query.{{ .Values.user }}-monitoring.svc.cluster.local:10902
|
||||
version: 1
|
||||
{{- if .Values.grafana.datasources }}
|
||||
{{- toYaml .Values.grafana.datasources | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
@ -1,23 +0,0 @@
|
||||
{{- 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,28 +0,0 @@
|
||||
{{- 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 }}
|
@ -1,30 +0,0 @@
|
||||
{{- 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 }}
|
@ -1,22 +0,0 @@
|
||||
{{- 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,20 +0,0 @@
|
||||
{{- 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 }}
|
@ -7,11 +7,7 @@ metadata:
|
||||
app.kubernetes.io/name: prometheus
|
||||
name: prometheus
|
||||
spec:
|
||||
{{- if .Values.query.enabled }}
|
||||
thanos:
|
||||
image: quay.io/thanos/thanos:v0.32.3
|
||||
{{- end }}
|
||||
scrapeInterval: 60s
|
||||
scrapeInterval: 10s
|
||||
serviceAccountName: prometheus-{{ .Values.user }}
|
||||
serviceMonitorNamespaceSelector:
|
||||
matchLabels:
|
||||
|
@ -25,11 +25,9 @@ spec:
|
||||
- --query.replica-label=thanos_ruler_replica
|
||||
- --endpoint=prometheus-operated.{{ .Values.user }}-monitoring.svc.cluster.local:10901
|
||||
- --endpoint=thanos-ruler-operated.{{ .Values.user }}-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
|
||||
- --endpoint=prometheus-operated.monitoring.svc.cluster.local:10901
|
||||
- --store.unhealthy-timeout=3d
|
||||
image: quay.io/thanos/thanos:v0.32.3
|
||||
image: quay.io/thanos/thanos:v0.25.1
|
||||
name: thanos-query
|
||||
ports:
|
||||
- containerPort: 10902
|
||||
|
@ -7,26 +7,12 @@ metadata:
|
||||
app.kubernetes.io/name: thanos-ruler
|
||||
name: thanos-ruler
|
||||
spec:
|
||||
image: quay.io/thanos/thanos:v0.28.1
|
||||
alertQueryUrl: {{ .Values.user }}-thanos-query.training.cluster.acend.ch
|
||||
evaluationInterval: 10s
|
||||
queryEndpoints:
|
||||
- dnssrv+_http._tcp.thanos-query:10902
|
||||
- thanos-query.{{ .Values.user }}-monitoring.svc.cluster.local:10902
|
||||
ruleSelector: {}
|
||||
ruleNamespaceSelector:
|
||||
matchLabels:
|
||||
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 }}
|
@ -2,18 +2,6 @@
|
||||
|
||||
{{- if .Values.alertmanager.enabled }}
|
||||
{{- 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 }}
|
||||
|
||||
# grafana
|
||||
@ -24,7 +12,6 @@
|
||||
{{- template "grafana.svc" . }}
|
||||
{{- template "grafana.sa" . }}
|
||||
{{- template "grafana.deploy" . }}
|
||||
{{- template "grafana.servicemonitor" . }}
|
||||
{{- template "grafana.ingress" . }}
|
||||
{{- end }}
|
||||
|
||||
@ -32,7 +19,6 @@
|
||||
{{- if .Values.prometheus.enabled }}
|
||||
{{- template "prometheus.ingress" . }}
|
||||
{{- template "prometheus.prometheus" . }}
|
||||
{{- template "prometheus.servicemonitor" . }}
|
||||
{{- template "prometheus.role" . }}
|
||||
{{- template "prometheus.rolebinding" . }}
|
||||
{{- template "prometheus.sa" . }}
|
||||
|
@ -2,7 +2,6 @@ apiVersion: v1
|
||||
data:
|
||||
admin: JDEkSzNRZUlsOHAkZVZZb1h2RERNWk40b3RJT2tBc3AwLw== # $(openssl passwd -1 admin)
|
||||
{{ .Values.user }}: JDEkSzNRZUlsOHAkZVZZb1h2RERNWk40b3RJT2tBc3AwLw== # $(openssl passwd -1 admin)
|
||||
grafana_user: {{ .Values.user | b64enc }}
|
||||
kind: Secret
|
||||
metadata:
|
||||
labels:
|
||||
|
@ -1,22 +1,25 @@
|
||||
user: <user> # Replace me
|
||||
# prometheus
|
||||
prometheus:
|
||||
enabled: false
|
||||
# thanos-query
|
||||
query:
|
||||
enabled: false
|
||||
# grafana
|
||||
grafana:
|
||||
enabled: false
|
||||
# blackboxexporter
|
||||
blackboxexporter:
|
||||
enabled: false
|
||||
# pushgateway
|
||||
pushgateway:
|
||||
enabled: false
|
||||
user: user1
|
||||
|
||||
# alertmanager
|
||||
alertmanager:
|
||||
enabled: false
|
||||
enabled: true
|
||||
|
||||
# grafana
|
||||
grafana:
|
||||
enabled: true
|
||||
|
||||
# prometheus
|
||||
prometheus:
|
||||
enabled: true
|
||||
|
||||
# pushgeitwey
|
||||
pushgateway:
|
||||
enabled: true
|
||||
|
||||
# thanos-ruler
|
||||
ruler:
|
||||
enabled: false
|
||||
enabled: true
|
||||
|
||||
# thanos-query
|
||||
query:
|
||||
enabled: true
|
@ -1,3 +0,0 @@
|
||||
# Readme
|
||||
|
||||
This is the location for the user demo app.
|
Loading…
x
Reference in New Issue
Block a user