Compare commits
18 Commits
user-monit
...
kube-prome
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d4d467e28 | ||
|
|
28b1c17e13 | ||
|
|
dbb0cc23da | ||
|
|
73c8c6435f | ||
|
|
7385c2af41 | ||
|
|
4482493d5f | ||
|
|
00ba693670 | ||
|
|
3fc8e332ea | ||
|
|
c58fbd2334 | ||
|
|
4df31ddaf6 | ||
|
|
9b00f330b3 | ||
|
|
7bf01de75f | ||
|
|
9687f504e1 | ||
|
|
8e43add4da | ||
|
|
7a01cc94b6 | ||
|
|
01fe8162c3 | ||
|
|
68df02b47a | ||
|
|
d6a569fa0a |
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"]
|
|
||||||
@@ -1 +1 @@
|
|||||||
user: user1
|
user: userX # Replace me
|
||||||
23
charts/user-monitoring-stack/.helmignore
Normal file
23
charts/user-monitoring-stack/.helmignore
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
6
charts/user-monitoring-stack/Chart.lock
Normal file
6
charts/user-monitoring-stack/Chart.lock
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: kube-prometheus-stack
|
||||||
|
repository: https://prometheus-community.github.io/helm-charts
|
||||||
|
version: 51.5.3
|
||||||
|
digest: sha256:8e25b83cde5acfd903c3e45f30b9ae28201f9dd68daab1aeca709f1185608916
|
||||||
|
generated: "2023-10-12T13:25:38.219319684+02:00"
|
||||||
29
charts/user-monitoring-stack/Chart.yaml
Normal file
29
charts/user-monitoring-stack/Chart.yaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: user-monitoring-stack
|
||||||
|
description: A Helm chart for Kubernetes
|
||||||
|
|
||||||
|
# A chart can be either an 'application' or a 'library' chart.
|
||||||
|
#
|
||||||
|
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||||
|
# to be deployed.
|
||||||
|
#
|
||||||
|
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||||
|
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||||
|
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||||
|
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.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
|
||||||
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
|
# It is recommended to use it with quotes.
|
||||||
|
appVersion: "1.16.0"
|
||||||
|
dependencies:
|
||||||
|
- name: kube-prometheus-stack
|
||||||
|
condition: promstack.enabled
|
||||||
|
version: "51.5.3"
|
||||||
|
repository: "https://prometheus-community.github.io/helm-charts"
|
||||||
Binary file not shown.
73
charts/user-monitoring-stack/values.yaml
Normal file
73
charts/user-monitoring-stack/values.yaml
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
promstack:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
kube-prometheus-stack:
|
||||||
|
prometheus:
|
||||||
|
enabled: true
|
||||||
|
prometheusSpec:
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 400Mi
|
||||||
|
scrapeInterval: 60s
|
||||||
|
serviceMonitorNamespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
user: <user>
|
||||||
|
serviceMonitorSelector: {}
|
||||||
|
podMonitorNamespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
user: <user>
|
||||||
|
podMonitorSelector: {}
|
||||||
|
probeNamespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
user: <user>
|
||||||
|
ruleSelectorNilUsesHelmValues: false
|
||||||
|
serviceMonitorSelectorNilUsesHelmValues: false
|
||||||
|
podMonitorSelectorNilUsesHelmValues: false
|
||||||
|
probeSelectorNilUsesHelmValues: false
|
||||||
|
serviceAccount:
|
||||||
|
create: true
|
||||||
|
name: "prometheus-<user>"
|
||||||
|
grafana:
|
||||||
|
enabled: false
|
||||||
|
alertmanager:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
kubernetesServiceMonitors:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# not relevant for the lab
|
||||||
|
crds:
|
||||||
|
enabled: false
|
||||||
|
kubeProxy:
|
||||||
|
enabled: false
|
||||||
|
kubeScheduler:
|
||||||
|
enabled: false
|
||||||
|
kubeControllerManager:
|
||||||
|
enabled: false
|
||||||
|
kubeEtcd:
|
||||||
|
enabled: false
|
||||||
|
kubeApiServer:
|
||||||
|
enabled: false
|
||||||
|
kubelet:
|
||||||
|
enabled: false
|
||||||
|
coreDns:
|
||||||
|
enabled: false
|
||||||
|
kubeStateMetrics:
|
||||||
|
enabled: false
|
||||||
|
nodeExporter:
|
||||||
|
enabled: false
|
||||||
|
prometheusOperator:
|
||||||
|
enabled: false
|
||||||
|
kubeletService:
|
||||||
|
enabled: false
|
||||||
|
defaultRules:
|
||||||
|
create: false
|
||||||
|
|
||||||
|
|
||||||
|
global:
|
||||||
|
rbac:
|
||||||
|
create: false
|
||||||
|
createAggregateClusterRoles: false
|
||||||
@@ -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.4
|
version: 0.2.5
|
||||||
|
|
||||||
# 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,3 +1,5 @@
|
|||||||
|
{{- define "alertmanager.alertmanager" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: Alertmanager
|
kind: Alertmanager
|
||||||
metadata:
|
metadata:
|
||||||
@@ -5,3 +7,4 @@ metadata:
|
|||||||
app.kubernetes.io/name: {{ .Values.user }}-am
|
app.kubernetes.io/name: {{ .Values.user }}-am
|
||||||
name: {{ .Values.user }}-am
|
name: {{ .Values.user }}-am
|
||||||
spec: {}
|
spec: {}
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "blackboxexporter.cm" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
@@ -34,3 +36,4 @@ data:
|
|||||||
valid_status_codes: [400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 418, 420, 444, 449, 499]
|
valid_status_codes: [400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 418, 420, 444, 449, 499]
|
||||||
tcp_connect:
|
tcp_connect:
|
||||||
prober: tcp
|
prober: tcp
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "blackboxexporter.deploy" }}
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -38,3 +40,4 @@ spec:
|
|||||||
configMap:
|
configMap:
|
||||||
defaultMode: 420
|
defaultMode: 420
|
||||||
name: blackbox-exporter-config
|
name: blackbox-exporter-config
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "grafana.dashboardprovider" }}
|
||||||
|
---
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
@@ -15,3 +17,4 @@ data:
|
|||||||
path: /var/lib/grafana/dashboards/general
|
path: /var/lib/grafana/dashboards/general
|
||||||
orgId: 1
|
orgId: 1
|
||||||
type: file
|
type: file
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "grafana.datasource" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
type: Opaque
|
type: Opaque
|
||||||
@@ -16,3 +18,7 @@ stringData:
|
|||||||
type: prometheus
|
type: prometheus
|
||||||
url: http://thanos-query.{{ .Values.user }}-monitoring.svc.cluster.local:10902
|
url: http://thanos-query.{{ .Values.user }}-monitoring.svc.cluster.local:10902
|
||||||
version: 1
|
version: 1
|
||||||
|
{{- if .Values.grafana.datasources }}
|
||||||
|
{{- toYaml .Values.grafana.datasources | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "grafana.deploy" }}
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -111,3 +113,4 @@ spec:
|
|||||||
name: dashboard-volume
|
name: dashboard-volume
|
||||||
- emptyDir: {}
|
- emptyDir: {}
|
||||||
name: datasource-volume
|
name: datasource-volume
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "grafana.ingress" }}
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
@@ -23,3 +25,4 @@ spec:
|
|||||||
- hosts:
|
- hosts:
|
||||||
- {{ .Values.user }}-grafana.training.cluster.acend.ch
|
- {{ .Values.user }}-grafana.training.cluster.acend.ch
|
||||||
secretName: acend-wildcard
|
secretName: acend-wildcard
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "grafana.rolebinding" }}
|
||||||
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
@@ -11,3 +13,4 @@ roleRef:
|
|||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: grafana
|
name: grafana
|
||||||
|
{{- end }}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
|
{{- define "grafana.sa" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: grafana
|
app.kubernetes.io/name: grafana
|
||||||
name: grafana
|
name: grafana
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "grafana.svc" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -13,3 +15,4 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: grafana
|
app.kubernetes.io/name: grafana
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "prometheus.ingress" }}
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
@@ -25,3 +27,4 @@ spec:
|
|||||||
- hosts:
|
- hosts:
|
||||||
- {{ .Values.user }}-prometheus.training.cluster.acend.ch
|
- {{ .Values.user }}-prometheus.training.cluster.acend.ch
|
||||||
secretName: acend-wildcard
|
secretName: acend-wildcard
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "prometheus.role" }}
|
||||||
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
@@ -20,3 +22,4 @@ rules:
|
|||||||
resources:
|
resources:
|
||||||
- ingresses
|
- ingresses
|
||||||
verbs: ["get", "list", "watch"]
|
verbs: ["get", "list", "watch"]
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "prometheus.rolebinding" }}
|
||||||
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
@@ -11,3 +13,4 @@ roleRef:
|
|||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: prometheus-{{ .Values.user }}
|
name: prometheus-{{ .Values.user }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
|
{{- define "prometheus.sa" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: prometheus-{{ .Values.user }}
|
app.kubernetes.io/name: prometheus-{{ .Values.user }}
|
||||||
name: prometheus-{{ .Values.user }}
|
name: prometheus-{{ .Values.user }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "prometheus.prometheus" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: Prometheus
|
kind: Prometheus
|
||||||
metadata:
|
metadata:
|
||||||
@@ -5,7 +7,7 @@ metadata:
|
|||||||
app.kubernetes.io/name: prometheus
|
app.kubernetes.io/name: prometheus
|
||||||
name: prometheus
|
name: prometheus
|
||||||
spec:
|
spec:
|
||||||
scrapeInterval: 10s
|
scrapeInterval: 60s
|
||||||
serviceAccountName: prometheus-{{ .Values.user }}
|
serviceAccountName: prometheus-{{ .Values.user }}
|
||||||
serviceMonitorNamespaceSelector:
|
serviceMonitorNamespaceSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
@@ -25,3 +27,4 @@ spec:
|
|||||||
enableAdminAPI: true
|
enableAdminAPI: true
|
||||||
externalLabels:
|
externalLabels:
|
||||||
monitoring: {{ .Values.user }}
|
monitoring: {{ .Values.user }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "pushgateway.deploy" }}
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -28,3 +30,4 @@ spec:
|
|||||||
httpGet:
|
httpGet:
|
||||||
path: /-/ready
|
path: /-/ready
|
||||||
port: web
|
port: web
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "pushgateway.servicemonitor" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
@@ -7,9 +9,10 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
endpoints:
|
endpoints:
|
||||||
- interval: 30s
|
- interval: 30s
|
||||||
port: web
|
port: http
|
||||||
honorLabels: true
|
honorLabels: true
|
||||||
namespaceSelector: {}
|
namespaceSelector: {}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/name: pushgateway
|
app.kubernetes.io/name: pushgateway
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "pushgateway.svc" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -13,3 +15,4 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: pushgateway
|
app.kubernetes.io/name: pushgateway
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "query.deploy" }}
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -24,6 +26,7 @@ spec:
|
|||||||
- --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
|
- --endpoint=prometheus-operated.monitoring.svc.cluster.local:10901
|
||||||
|
- --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.25.1
|
||||||
name: thanos-query
|
name: thanos-query
|
||||||
@@ -32,3 +35,4 @@ spec:
|
|||||||
name: http
|
name: http
|
||||||
- containerPort: 10901
|
- containerPort: 10901
|
||||||
name: grpc
|
name: grpc
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "query.ingress" }}
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
@@ -25,3 +27,4 @@ spec:
|
|||||||
- hosts:
|
- hosts:
|
||||||
- {{ .Values.user }}-thanos-query.training.cluster.acend.ch
|
- {{ .Values.user }}-thanos-query.training.cluster.acend.ch
|
||||||
secretName: acend-wildcard
|
secretName: acend-wildcard
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "query.svc" }}
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -13,3 +15,4 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: thanos-query
|
app.kubernetes.io/name: thanos-query
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "ruler.ingress" }}
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
@@ -5,11 +7,11 @@ metadata:
|
|||||||
haproxy.org/auth-secret: basic-auth
|
haproxy.org/auth-secret: basic-auth
|
||||||
haproxy.org/auth-type: basic-auth
|
haproxy.org/auth-type: basic-auth
|
||||||
haproxy.org/auth-realm: Authentication Required
|
haproxy.org/auth-realm: Authentication Required
|
||||||
name: user1-thanos-ruler
|
name: {{ .Values.user }}-thanos-ruler
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: haproxy
|
ingressClassName: haproxy
|
||||||
rules:
|
rules:
|
||||||
- host: user1-thanos-ruler.training.cluster.acend.ch
|
- host: {{ .Values.user }}-thanos-ruler.training.cluster.acend.ch
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- backend:
|
- backend:
|
||||||
@@ -21,5 +23,6 @@ spec:
|
|||||||
pathType: ImplementationSpecific
|
pathType: ImplementationSpecific
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- user1-thanos-ruler.training.cluster.acend.ch
|
- {{ .Values.user }}-thanos-ruler.training.cluster.acend.ch
|
||||||
secretName: acend-wildcard
|
secretName: acend-wildcard
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{- define "ruler.ruler" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ThanosRuler
|
kind: ThanosRuler
|
||||||
metadata:
|
metadata:
|
||||||
@@ -13,3 +15,4 @@ spec:
|
|||||||
ruleNamespaceSelector:
|
ruleNamespaceSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
user: {{ .Values.user }}
|
user: {{ .Values.user }}
|
||||||
|
{{- end }}
|
||||||
44
charts/user-monitoring/templates/monitoring.yaml
Normal file
44
charts/user-monitoring/templates/monitoring.yaml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# alertmanager
|
||||||
|
|
||||||
|
{{- if .Values.alertmanager.enabled }}
|
||||||
|
{{- template "alertmanager.alertmanager" . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
# grafana
|
||||||
|
{{- if .Values.grafana.enabled }}
|
||||||
|
{{- template "grafana.datasource" . }}
|
||||||
|
{{- template "grafana.dashboardprovider" . }}
|
||||||
|
{{- template "grafana.rolebinding" . }}
|
||||||
|
{{- template "grafana.svc" . }}
|
||||||
|
{{- template "grafana.sa" . }}
|
||||||
|
{{- template "grafana.deploy" . }}
|
||||||
|
{{- template "grafana.ingress" . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
# prometheus
|
||||||
|
{{- if .Values.prometheus.enabled }}
|
||||||
|
{{- template "prometheus.ingress" . }}
|
||||||
|
{{- template "prometheus.prometheus" . }}
|
||||||
|
{{- template "prometheus.role" . }}
|
||||||
|
{{- template "prometheus.rolebinding" . }}
|
||||||
|
{{- template "prometheus.sa" . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .Values.pushgateway.enabled }}
|
||||||
|
{{- template "pushgateway.deploy" . }}
|
||||||
|
{{- template "pushgateway.servicemonitor" . }}
|
||||||
|
{{- template "pushgateway.svc" . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
# thanos-ruler
|
||||||
|
{{- if .Values.ruler.enabled }}
|
||||||
|
{{- template "ruler.ruler" . }}
|
||||||
|
{{- template "ruler.ingress" . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
# thanos-query
|
||||||
|
{{- if .Values.query.enabled }}
|
||||||
|
{{- template "query.deploy" . }}
|
||||||
|
{{- template "query.ingress" . }}
|
||||||
|
{{- template "query.svc" . }}
|
||||||
|
{{- end }}
|
||||||
@@ -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 +1,32 @@
|
|||||||
user: user1
|
user: <user> # Replace me
|
||||||
|
|
||||||
|
# prometheus
|
||||||
|
prometheus:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
# thanos-query
|
||||||
|
query:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
# grafana
|
||||||
|
grafana:
|
||||||
|
datasources:
|
||||||
|
- name: prometheus
|
||||||
|
access: proxy
|
||||||
|
editable: false
|
||||||
|
type: prometheus
|
||||||
|
url: http://prometheus-operated.<user>-monitoring.svc.cluster.local:9090
|
||||||
|
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.
|
||||||
Reference in New Issue
Block a user