From ef1f8bb44092709785f87324df1949ec71de2b8e Mon Sep 17 00:00:00 2001 From: Andrei Kartashov Date: Mon, 25 Sep 2023 02:35:30 +0700 Subject: [PATCH] loki+promtail --- README.rst | 10 ++++ .../observability/loki/application.yaml | 49 +++++++++++++++++++ .../loki/manifests/grafanadatasource.yaml | 16 ++++++ .../observability/promtail/application.yaml | 27 ++++++++++ 4 files changed, 102 insertions(+) create mode 100644 state/gullfaxi/system/observability/loki/application.yaml create mode 100644 state/gullfaxi/system/observability/loki/manifests/grafanadatasource.yaml create mode 100644 state/gullfaxi/system/observability/promtail/application.yaml diff --git a/README.rst b/README.rst index c5527df..413f344 100644 --- a/README.rst +++ b/README.rst @@ -36,6 +36,10 @@ Applications & Projects +------------------------------+----------------------------------------------------------------+-------------------------+ | Local-Path-Provisioner_ | `Rancher Local-Path`_ | |local-path_status| | +------------------------------+----------------------------------------------------------------+-------------------------+ +| Loki_ | | |loki_status| | ++------------------------------+----------------------------------------------------------------+-------------------------+ +| Promtail_ | | |promtail_status| | ++------------------------------+----------------------------------------------------------------+-------------------------+ | Prometheus-node-exporter_ | `Node exporter`_ | |pne_status| | +------------------------------+----------------------------------------------------------------+-------------------------+ | Victoria-Metrics-Operator_ | `Victoria Metrics Operator`_ | |vm-op_status| | @@ -98,6 +102,12 @@ Applications & Projects .. _Rancher Local-Path: https://github.com/rancher/local-path-provisioner .. |local-path_status| image:: https://argocd.ioot.xyz/api/badge?name=local-path-provisioner&revision=true +.. _Loki: https://argocd.ioot.xyz/applications/argocd/loki +.. |loki_status| image:: https://argocd.ioot.xyz/api/badge?name=loki&revision=true + +.. _Promtail: https://argocd.ioot.xyz/applications/argocd/promtail +.. |promtail_status| image:: https://argocd.ioot.xyz/api/badge?name=promtail&revision=true + .. _Prometheus-node-exporter: https://argocd.ioot.xyz/applications/argocd/prometheus-node-exporter .. _Node exporter: https://github.com/prometheus/node_exporter .. |pne_status| image:: https://argocd.ioot.xyz/api/badge?name=prometheus-node-exporter&revision=true diff --git a/state/gullfaxi/system/observability/loki/application.yaml b/state/gullfaxi/system/observability/loki/application.yaml new file mode 100644 index 0000000..16f1017 --- /dev/null +++ b/state/gullfaxi/system/observability/loki/application.yaml @@ -0,0 +1,49 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: loki + labels: + stack: observability +spec: + destination: + server: https://kubernetes.default.svc + namespace: loki + project: system + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + sources: + - repoURL: git@github.com:amkartashov/gf-k8s.git + targetRevision: main + path: state/gullfaxi/system/observability/loki/manifests + - repoURL: https://grafana.github.io/helm-charts + chart: loki + targetRevision: 5.23.0 + helm: + values: | + # https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml + # https://grafana.com/docs/loki/latest/setup/install/helm/install-monolithic/ + gateway: + enabled: false + singleBinary: + replicas: 1 + persistence: + enableStatefulSetAutoDeletePVC: false + loki: + auth_enabled: false + commonConfig: + replication_factor: 1 + storage: + type: filesystem + test: + enabled: false + monitoring: + selfMonitoring: + enabled: false + grafanaAgent: + installOperator: false + lokiCanary: + enabled: false diff --git a/state/gullfaxi/system/observability/loki/manifests/grafanadatasource.yaml b/state/gullfaxi/system/observability/loki/manifests/grafanadatasource.yaml new file mode 100644 index 0000000..03ab337 --- /dev/null +++ b/state/gullfaxi/system/observability/loki/manifests/grafanadatasource.yaml @@ -0,0 +1,16 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + name: loki +spec: + allowCrossNamespaceImport: true + instanceSelector: + matchLabels: + instance: grafana + datasource: + name: loki + type: loki + access: proxy + url: http://loki.loki:3100 + isDefault: true + editable: false diff --git a/state/gullfaxi/system/observability/promtail/application.yaml b/state/gullfaxi/system/observability/promtail/application.yaml new file mode 100644 index 0000000..3094192 --- /dev/null +++ b/state/gullfaxi/system/observability/promtail/application.yaml @@ -0,0 +1,27 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: promtail + labels: + stack: observability +spec: + destination: + server: https://kubernetes.default.svc + namespace: promtail + project: system + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + sources: + - repoURL: https://grafana.github.io/helm-charts + chart: promtail + targetRevision: 6.15.2 + helm: + values: | + # https://github.com/grafana/helm-charts/blob/main/charts/promtail/values.yaml + config: + clients: + - url: http://loki.loki:3100/loki/api/v1/push