diff --git a/infrastructure/loki/loki-datasource-configmap.yaml b/infrastructure/loki/loki-datasource-configmap.yaml new file mode 100644 index 0000000..a6843c6 --- /dev/null +++ b/infrastructure/loki/loki-datasource-configmap.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: loki-grafana-datasource + namespace: monitoring + labels: + grafana_datasource: "1" +data: + loki-datasource.yaml: | + apiVersion: 1 + datasources: + - name: Loki + type: loki + access: proxy + url: http://loki-stack:3100 + isDefault: false diff --git a/infrastructure/loki/loki-stack-app.yaml b/infrastructure/loki/loki-stack-app.yaml new file mode 100644 index 0000000..b04121d --- /dev/null +++ b/infrastructure/loki/loki-stack-app.yaml @@ -0,0 +1,40 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: loki-stack + namespace: argocd +spec: + project: default + source: + repoURL: https://grafana.github.io/helm-charts + targetRevision: 2.10.3 + chart: loki-stack + helm: + values: | + # Eigenes Grafana nicht noetig, wir haben schon eins ueber kube-prometheus-stack + grafana: + enabled: false + + promtail: + enabled: true + + loki: + persistence: + enabled: true + size: 10Gi + config: + table_manager: + retention_deletes_enabled: true + retention_period: 168h + + destination: + server: https://kubernetes.default.svc + namespace: monitoring + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + - ServerSideApply=true + - SkipDryRunOnMissingResource=true diff --git a/infrastructure/prometheus/grafana-ingress.yaml b/infrastructure/prometheus/grafana-ingress.yaml new file mode 100644 index 0000000..6486d77 --- /dev/null +++ b/infrastructure/prometheus/grafana-ingress.yaml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: grafana-ingress + namespace: monitoring + annotations: + kubernetes.io/ingress.class: traefik + cert-manager.io/cluster-issuer: letsencrypt-prod +spec: + ingressClassName: traefik + rules: + - host: grafana.unreg-hdw.de + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: prometheus-stack-grafana + port: + number: 80 + tls: + - hosts: + - grafana.unreg-hdw.de + secretName: grafana-tls-cert