Release version 0.2.0

This commit is contained in:
Raffael H 2023-08-10 14:49:17 +02:00
parent d6a569fa0a
commit 68df02b47a
27 changed files with 123 additions and 9 deletions

View File

@ -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.5 version: 0.2.0-U+1F992
# 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

View File

@ -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 }}

View File

@ -1,3 +1,4 @@
{{- define "blackboxexporter.cm" }}
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
@ -34,3 +35,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 }}

View File

@ -1,3 +1,4 @@
{{- define "blackboxexporter.deploy" }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
@ -38,3 +39,4 @@ spec:
configMap: configMap:
defaultMode: 420 defaultMode: 420
name: blackbox-exporter-config name: blackbox-exporter-config
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "grafana.dashboardprovider" }}
kind: ConfigMap kind: ConfigMap
apiVersion: v1 apiVersion: v1
metadata: metadata:
@ -15,3 +16,4 @@ data:
path: /var/lib/grafana/dashboards/general path: /var/lib/grafana/dashboards/general
orgId: 1 orgId: 1
type: file type: file
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "grafana.datasource" }}
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
type: Opaque type: Opaque
@ -16,3 +17,4 @@ 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
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "grafana.deploy" }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
@ -111,3 +112,4 @@ spec:
name: dashboard-volume name: dashboard-volume
- emptyDir: {} - emptyDir: {}
name: datasource-volume name: datasource-volume
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "grafana.ingress" }}
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
@ -23,3 +24,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 }}

View File

@ -1,3 +1,4 @@
{{- define "grafana.rolebinding" }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
@ -11,3 +12,4 @@ roleRef:
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: grafana name: grafana
{{- end }}

View File

@ -1,6 +1,8 @@
{{- 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 }}

View File

@ -1,3 +1,4 @@
{{- define "grafana.svc" }}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@ -13,3 +14,4 @@ spec:
selector: selector:
app.kubernetes.io/name: grafana app.kubernetes.io/name: grafana
type: ClusterIP type: ClusterIP
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "prometheus.ingress" }}
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
@ -25,3 +26,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 }}

View File

@ -1,3 +1,4 @@
{{- define "prometheus.role" }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: Role kind: Role
metadata: metadata:
@ -20,3 +21,4 @@ rules:
resources: resources:
- ingresses - ingresses
verbs: ["get", "list", "watch"] verbs: ["get", "list", "watch"]
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "prometheus.rolebinding" }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
@ -11,3 +12,4 @@ roleRef:
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: prometheus-{{ .Values.user }} name: prometheus-{{ .Values.user }}
{{- end }}

View File

@ -1,7 +1,8 @@
{{- 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 }}

View File

@ -1,3 +1,4 @@
{{- define "prometheus.prometheus" }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: Prometheus kind: Prometheus
metadata: metadata:
@ -25,3 +26,4 @@ spec:
enableAdminAPI: true enableAdminAPI: true
externalLabels: externalLabels:
monitoring: {{ .Values.user }} monitoring: {{ .Values.user }}
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "pushgateway.deploy" }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
@ -28,3 +29,4 @@ spec:
httpGet: httpGet:
path: /-/ready path: /-/ready
port: web port: web
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "pushgateway.servicemonitor" }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
@ -13,3 +14,4 @@ spec:
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: pushgateway app.kubernetes.io/name: pushgateway
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "pushgateway.svc" }}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@ -13,3 +14,4 @@ spec:
selector: selector:
app.kubernetes.io/name: pushgateway app.kubernetes.io/name: pushgateway
type: ClusterIP type: ClusterIP
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "query.deploy" }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
@ -32,3 +33,4 @@ spec:
name: http name: http
- containerPort: 10901 - containerPort: 10901
name: grpc name: grpc
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "query.ingress" }}
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
@ -25,3 +26,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 }}

View File

@ -1,3 +1,4 @@
{{- define "query.svc" }}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@ -13,3 +14,4 @@ spec:
selector: selector:
app.kubernetes.io/name: thanos-query app.kubernetes.io/name: thanos-query
type: ClusterIP type: ClusterIP
{{- end }}

View File

@ -1,3 +1,4 @@
{{- define "ruler.ingress" }}
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
@ -5,11 +6,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 +22,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 }}

View File

@ -1,3 +1,4 @@
{{- define "ruler.ruler" }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ThanosRuler kind: ThanosRuler
metadata: metadata:
@ -13,3 +14,4 @@ spec:
ruleNamespaceSelector: ruleNamespaceSelector:
matchLabels: matchLabels:
user: {{ .Values.user }} user: {{ .Values.user }}
{{- end }}

View 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 }}

View File

@ -1 +1,25 @@
user: user1 user: user1
# alertmanager
alertmanager:
enabled: true
# grafana
grafana:
enabled: true
# prometheus
prometheus:
enabled: true
# pushgeitwey
pushgateway:
enabled: true
# thanos-ruler
ruler:
enabled: true
# thanos-query
query:
enabled: true